전체 글92 [백준] 2941번 크로아티아 알파벳 (문자열) -문제 -코드 #include #include using namespace std; int main() { string s; cin >> s; int res = 0, i = 0, size = s.size(); while (size >= i) { if (s[i] == '\0') break; if (s[i] == 'c') { if (s[i + 1] == '=') i += 2; else if (s[i + 1] == '-') i += 2; else i++; } else if (s[i] == 'l' && s[i + 1] == 'j') i += 2; else if (s[i] == 'n' && s[i + 1] == 'j') i += 2; else if (s[i] == 's' && s[i + 1] == '=') i +.. 2022. 8. 3. [백준] 1764번 듣보잡 (맵) -문제 -코드 #include #include #include #include #include using namespace std; int main() { int n, m; cin >> n >> m; map map; vector res; for (int i = 0; i > tmp; map[tmp]++; if (map[tmp] > 1) res.push_back(tmp); } sort(res.begin(), res.end()); cout 2022. 8. 3. [백준] 1541번 잃어버린 괄호 (문자열) -문제 -코드 #include #include using namespace std; int main() { string s; cin >> s; int res=0, tmp=0; bool minus = false; for (int i = 0; i 2022. 8. 3. [백준] 2675번 문자열 반복 (문자열) -문제 -코드 #include using namespace std; int main() { int t, r; char s[20]; scanf("%d", &t); for (int i = 0; i < t; i++) { scanf("%d %s", &r, s); for (int i = 0; s[i] != '\0'; i++) { for (int j = 0; j < r; j++) { printf("%c", s[i]); } } printf("\n"); } return 0; } 2022. 8. 3. 이전 1 ··· 13 14 15 16 17 18 19 ··· 23 다음