백준 알고리즘/문자열 처리6 백준 9935번 C++ #include #include using namespace std; const int MAX = 1000001; int main(void) { char str[MAX]; string s,bomb; int indexs = 0, flag, bomblen; cin >> s >> bomb; bomblen = bomb.length(); for (int i = 0; i < s.length(); i++) { str[indexs++] = s[i]; if ((indexs - bomblen) < 0) continue; if (str[indexs-1] == bomb[bomblen - 1]) { flag = 0; for (int j = 0; j < bomblen; j++) { if (str[indexs - j -1] != .. 2019. 8. 31. 백준 1032번 C++ #include #include using namespace std; const int MAX = 51; int main(void) { int n; string str[MAX]; cin >> n; for (int i = 0; i > str[i]; for (int i = 0; i < str[0].length(); i++) { for (int j = 1; j < n; j++) { if (str[0][i] != str[j][i]) { str[0][i] = '?'; break; } } cout 2019. 8. 31. 백준 1475번 C++ #include #include #include using namespace std; int num[9]; int main(void) { string s; int answer = 0; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == '6' || s[i] == '9') { num[6] ++; answer = max(answer, (num[6])/2 + num[6]%2); } else { num[s[i] - '0'] ++; answer = max(answer, num[s[i] - '0']); } } cout 2019. 8. 31. 백준 1157번 C++ #include #include #include using namespace std; const int MAX = 26; int answer[MAX]; int main(void) { int maxnum = -1, counts = 0;; string s; cin >> s; for (int i = 0; i = 'A' && s[i] = 'a' && s[i] 1) cout 2019. 8. 31. 이전 1 2 다음