목록백준/브론즈 (26)
Taene's
// 일반 풀이#include using namespace std;string pel;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> pel; int start = 0; int end = pel.length() - 1; while (start // algorithm - reverse() 사용#include #include using namespace std;string pel;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> pel; string tmp = pel; reverse(pel.begin(), pel.end()); if (tmp == ..
https://www.acmicpc.net/problem/11655 // 알파벳 개수=26, 'A'=65, 'a'=97#include #include using namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s, answer; getline(cin, s); for (int i = 0; i = 'A' && s[i] 'Z') temp -= 26; answer += (char)temp; } else if (s[i] >= 'a' && s[i] 'z') temp -= 26; answer += (char)temp; } else answer += s[i]; } cout // 2회차 풀이#..
https://www.acmicpc.net/problem/2979 // 시각은 [이상, 미만) 범위다.#include using namespace std;int A, B, C, sum;int cnt[100];int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> A >> B >> C; for (int i = 0; i > start >> end; for (int j = start; j // 2회차 풀이#include using namespace std;int a, b, c;int arr[102];int sum;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ci..
https://www.acmicpc.net/problem/10808 1. 배열 사용#include using namespace std;string S;int cnt[26];int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> S; for (int i = 0; i 2. map 사용#include #include using namespace std;string S;map cnt;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> S; for (int i = 0; i
https://www.acmicpc.net/problem/2309 1-1. 조합(9C7), 재귀로 푼 답#include #include #include using namespace std;vector cm;vector answer;void combi(int depth, vector& cm, vector& ans){ if (ans.size() == 7) { int sum = 0; for (auto i : ans) sum += i; if (sum == 100) { sort(ans.begin(), ans.end()); for (auto i : ans) cout > temp; cm.push_back(temp); } combi(0, cm, answer); return 0;} 1-2. 조합..