![[C++] 백준 4단계 - 10818번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcenQ92%2Fbtr591ylVeA%2FAAAAAAAAAAAAAAAAAAAAAAdXJ6Y3SdAg8Np0MPAyq0MW5-rWv8j9CAO_73ewFswj%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DfWigIDUReQLQwhVIKmlTk1HRKBQ%253D)
문제설명 소스코드 #include using namespace std; int main() { int N; int max; int min; cin >> N; int* arr = new int[N]; for (int i = 0; i > arr[i]; max = min = arr[0]; for (int i = 0; i max) max = arr[i]; if (arr[i] < min) min = arr[i]; } cout
![[C++] 백준 4단계 - 10871번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FmA85i%2Fbtr5TnPPNXm%2FAAAAAAAAAAAAAAAAAAAAAAhKsbTmAnhYX8IPU7tfAQXGiAlGPcwwWcmIu7mjpRQK%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DNI%252F238rmZOWvLiAZyW7ohvb01mE%253D)
문제설명 소스코드 #include using namespace std; int main() { int N; int X; cin >> N >> X; int* arr = new int[N]; for (int i = 0; i > arr[i]; for (int i = 0; i < N; ++i) if (arr[i] < X) cout
![[C++] 백준 4단계 - 10807번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcnhJ0i%2Fbtr5TqZ5UYI%2FAAAAAAAAAAAAAAAAAAAAAGachrCxAPZ5ODXOGnbN6aXhU3Z2nTxpJsGg5bPXK7fZ%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DFnfmej%252BHUOBM6igtiZxbH2Bm%252F%252Fg%253D)
문제설명 소스코드 #include using namespace std; int main() { int arrlength; int num = 0; int input; cin >> arrlength; int* arr = new int[arrlength]; for (int i = 0; i > arr[i]; cin >> input; for (int i = 0; i < arrlength; ++i) if (input == arr[i]) ++num; cout
![[C++] 백준 3단계 - 10951번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbpADzg%2Fbtr5Tn3ncD9%2FAAAAAAAAAAAAAAAAAAAAABrkyjuTmSM9lCnw28K1x99Y6ViU7Clwmlqsu9AkvDPD%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DBoIv6Kfgxiq8cUZ2NGrakpgL9uU%253D)
문제설명 소스코드 #include using namespace std; int main() { int a, b; while (!(cin >> a >> b).eof()) cout val; cout > a >> b).eof() 방식으로 괄호 안의 cin >> a >> b를 통해 읽은 후 eof상태인지를 검사하는 것이다. 따라서 아래와 같이 소스코드를 작성해야한다. while(!(cin >> a >> b).eof()) { ... } 출처 : https://st-lab.tistory.com/257
![[C++] 백준 3단계 - 10952번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FdrFqck%2Fbtr5PFYzNF3%2FAAAAAAAAAAAAAAAAAAAAAHjrl5tWKLIyqgB-McDdHO3Jk0liFTo75UPkqVo8KnNZ%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DyLZlqI7KV5vby7Wa2Y%252F7NZKAvSM%253D)
문제설명 소스코드 #include using namespace std; int main() { int A; int B; while (true) { cin >> A >> B; if (A == 0 && B == 0) break; else cout
![[C++] 백준 3단계 - 2439번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbbOBry%2Fbtr5O9rNrRo%2FAAAAAAAAAAAAAAAAAAAAAMqr7WLaRtC9lLfYrfl-9_0uW9Ga_EQllkMxCkwLBqQt%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DCCkS1empdjhCyiLf%252BQ%252BSYCg35dk%253D)
문제설명 소스코드 코드1 #include using namespace std; int main() { int input; cin >> input; for (int i = 1; i
![[C++] 백준 3단계 - 2438번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fs9W97%2Fbtr6bt9mY9f%2FAAAAAAAAAAAAAAAAAAAAAKpobFOYXasJPDi-FS_h9jJW6c3a_QbTyoTkg3WYJfRq%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DiLhAo1R4mlESKOup%252B6232F8LiAc%253D)
문제설명 소스코드 #include using namespace std; int main() { int input; cin >> input; for (int i = 1; i
![[C++] 백준 3단계 - 11022번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fn8tjc%2Fbtr5UlR49D2%2FAAAAAAAAAAAAAAAAAAAAAIx6JAySah-xJP83XQmvHRTzLjjPRh-reDrjI_eNrHX6%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DUZB3ztJDnd%252F0pxvPs0TyjMybwRA%253D)
문제설명 소스코드 #include using namespace std; int main() { int input; int A; int B; cin >> input; for (int i = 1; i > A >> B; cout