전체 글 썸네일형 리스트형 [C++]백준 알고리즘 11729번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #include #include #include using namespace std; vector order; int move(int num){ if(num == 1){ return 1; } return 2*move(num-1)+1; } void solve(int num, int a, int b){ if(num == 1){ order.push_back(make_tuple(a,b)); return; } solve(num-1,a,6-a-b); order.push_back(make_tuple(a,b.. 더보기 [C++]백준 알고리즘 2447번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #include using namespace std; int n; bool stars[6562][6562]; void solve(int num, int a, int b){ if(num == 3){ stars[a+1][b+1] = 1; return; } for(int i=a; i 더보기 [C++] 띄어쓰기 포함 여러개 문자열을 입력받을때 (cin, getline에 대하여) https://makedotworld.tistory.com/29 위의 글을 참고하여 포스팅합니다. [C++] C++에서 문자열 줄단위로 받기 알고리즘 문제를 풀면서 Input을 벡터 파라미터로 주는것이 아니라 문자열로 주는 경우, 또는 문자열 자체를 처리하는 알고리즘인 경우에 C++로 풀어야 되는경우, 익숙하지 않으면 문자열을 읽 makedotworld.tistory.com 위의 글을 통해서 cin의 경우에는 첫번째 개행문자(\n)는 무시하지만 getline의 경우에는 개행문자를 포함해서 읽는다는 점이었다. Codeground에서 연습문제를 풀고 있었는데 띄어쓰기를 포함해서 여러개의 문자열을 받으려고 하는데 cin으로 문자열의 개수를 n으로 받은 후 다음과 같이 하려고 하니 문제가 생겼다. 1 2 3 4.. 더보기 [C++]백준 알고리즘 1316번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 #include #include using namespace std; int main() { int n; cin >> n; string word[100]; int check[26]; for(int k=0; k word[i]; } int count = 0; for(int i=0; i 더보기 [C++]백준 알고리즘 2908번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include #include using namespace std; int main() { string a,b; cin >> a >> b; for(int i=2; i>=0; i--){ if(a[i] > b[i]){ cout 더보기 이전 1 2 3 4 5 6 ··· 8 다음