![[C++] 백준 9단계 - 5086번 문제 (배수와 약수)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbvjloU%2FbtseBfPwctZ%2FAAAAAAAAAAAAAAAAAAAAAPnz9yp75AEDTtUj32kgNExFvSnmgqPZ26Q_8zl52xzJ%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DEAhIN9prw0Ra5yISavqDEuIfjwM%253D)
문제설명 소스코드 #include using namespace std; int main() { int a, b; while (true) { cin >> a >> b; if ((a == 0) && (b == 0)) break; if (b % a == 0)cout
![[C++] 백준 8단계 - 10757번 문제 (큰 수 A+B)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fxans5%2FbtseyT7BP4X%2FAAAAAAAAAAAAAAAAAAAAAJu99efno9eCMxNKMTliyblORXh2YFUd0OhEh2TVBuv4%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DobFXLYIQPHZy4U9JF%252Ft6zdeSulI%253D)
문제설명 소스코드 #include using namespace std; int main() { string inputA, inputB; string tmp = ""; string result = ""; short A, B, digit; bool carry = false; cin >> inputA >> inputB; if (inputA.length() = 0; --i) { A = inputA[i] ..
![[C++] 백준 10단계 - 27323번 문제 (직사각형)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FEoM4H%2FbtsezCjIN08%2FAAAAAAAAAAAAAAAAAAAAAGlWQiEzLXbBPDgGc6x4xWHA4SYYnUS0iMUbm9rNT8tf%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DNCeKUsD56yh%252FjECY7eVIi%252BW%252F%252FvA%253D)
문제설명 소스코드 #include using namespace std; int main() { int A; int B; cin >> A >> B; cout
![[C++] 백준 8단계 - 2869번 문제 (달팽이는 올라가고 싶다)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FyDB4u%2FbtserDJW6SG%2FAAAAAAAAAAAAAAAAAAAAAL4IcVsDKxCzViUva9-7qCzc0cR2ea2mMYtPZZnM8gU6%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DoBzLON%252FmH5oGGC%252F%252Bq7G3b29imx0%253D)
문제설명 소스코드 #include using namespace std; int main() { int A; int B; int V; cin >> A >> B >> V; int count = (V - A) / (A - B); if ((V - A) % (A - B) == 0) count += 1; else count += 2; cout
![[C++] 백준 8단계 - 2292번 문제 (벌집)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcQPns7%2FbtsczLql4OZ%2FAAAAAAAAAAAAAAAAAAAAAOF22PjoqlCsBtKJtSFOMElGEQRglKaIYGxRuVEHF1UY%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DXXLC6SmXeGK3eVLcGVQT%252FecKsWs%253D)
문제설명 소스코드 #include using namespace std; int main() { int N; int idx = 1; cin >> N; --N; while (N > 0) { N -= (idx * 6); ++idx; } cout 2 -> 8 -> 20 -> 38 -> 62 ... 즉 첫번째 항을 제외하고, 6의 배수로 증가하는 수열이다. 따라서 N을 맨 처음에 1빼주고 계속 6의 배수만큼 빼주고 idx를 1증가 시킨다. N이 0 또는 음수가 되면 루프를 탈출한다. idx를 출력한다.
![[C++] 백준 11718번 문제 (그대로 출력하기)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FF4yZx%2FbtscCCyQYlK%2FAAAAAAAAAAAAAAAAAAAAACAqDlITbVUWxn62p0yVUsT7Op9XFIRam3SGmfT9k3N9%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DOF5XZiKfw4gOnWSGizy2245SCDE%253D)
문제설명 소스코드 #include #include using namespace std; int main() { string input; while (true) { getline(cin, input); if (input == "") return 0; cout
![[C++] 백준 8단계 - 2903번 문제 (중앙 이동 알고리즘)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2F0ojvs%2FbtsbUrfcQlN%2FAAAAAAAAAAAAAAAAAAAAALr_y8flwXLC74pVUuxxGIttw3Uq5pbhommuM1Ppjxyb%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DLNODRX%252BRI7Y4LcekxdnoK2yjmDo%253D)
문제설명 소스코드 #include #include using namespace std; int main() { int N; int arr[16] = { 0 }; arr[0] = 0; int dot = 0; cin >> N; for (int i = 1; i 5² -> 9²...로 증가하는 수열이다. 밑인 2, 3, 5, 9...의 수열(a')의 규칙은 아래와 같다. 따라서 밑수를 제곱한 값이 정답이 된다.
![[C++] 백준 8단계 - 2720번 문제 (세탁소 사장 동혁)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fb7JLvc%2FbtsbTWzwiol%2FAAAAAAAAAAAAAAAAAAAAAIu9clvkHRZLCm9xPXshS-9hDrCZu5ZP7wwyKw2UVAWq%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DLgPxGYd%252Be7BF4E%252B2ofiy8%252Bee5Qw%253D)
문제설명 소스코드 #include using namespace std; int main() { int T; int Q; int D; int N; int P; cin >> T; int* arr = new int[T]; for (int i = 0; i > arr[i]; Q = arr[i] / 25; P = arr[i] % 25; D = P / 10; P %= 10; N = P / 5; P %= 5; cout