목록C++ (24)
천천히 빛나는
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cA5NYi/btsryo0wouB/diFsHIFNIFqslF7qHDghw1/img.png)
10807. 총 N개의 정수가 주어졌을 때, 정수 v가 몇 개인지 구하는 프로그램을 작성하시오. #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, v; cin >> n; int* arr = new int[n]; for (int i = 0; i > arr[i]; } cin >> v; int count = 0; for (int i = 0; i n >> x; int* a = new int[n]; for (int i = 0; i > a[i]; } fo..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/NXTjR/btsrjpTuECI/DzC1a6DQU5kydZKdQXBbeK/img.png)
10950. 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. #include using namespace std; int main() { int n; cin >> n; for (int i = 1; i > n; int item, price, total = 0; for (int i = 0; i > item >> price; total += item * price; } if (x == total){ cout b; cout b) { ... } 위와 같은 방식도 가능하다. cin이 조건문 안에 있는 경우에 연산자 오버로딩에 의해 bool..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/be96nD/btsrcsXjGva/7IBz6QmREpV3H1qk9K77ok/img.png)
1330. 두 정수 A와 B가 주어졌을 때, A와 B를 비교하는 프로그램을 작성하시오. #include using namespace std; int main() { int a, b; cin >> a >> b; if (a > b) { cout = 90) { cout = 80) { cout = 70) { cout = 60) { cout year; if ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0))) { cout x >> y; if ((x > 0) && (y > 0)) { cout c; a += c / 60; b += c % 60; if (b >= 60) { b -= 60; a += 1; } if (a >= 24) { a -= 24; } cout ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Ocrbj/btsq5dr7ZVv/K58nfKOu6G5aDn8MoiugIK/img.png)
2557. Hello World!를 출력하시오. #include using namespace std; int main(){ cout A >> B; cout > a >> b;와 같이 계속해서 입력을 받을 수 있다. 1001. 두 정수 A와 B를 입력받은 다음, A-B를 출력하는 프로그램을 작성하시오. #include using namespace std; int main(){ int A, B; cin >> A >> B; cout > A >> B; cout > A >> B; cout > B; cout