반응형 백준A+B4 백준 알고리즘 10951번 A + B - 4 c++ 요약 : A와 B 입력 후 A+B의 값을 출력한다. 프로그램을 끝내는 조건문이 없으므로 while()에 조건문을 걸어두자. 소스코드 1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #include using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a,b; while(cin >> a >> b) { cout b; if(cin.eof()==true) break; //입력값이 없을 때 cout 2020. 12. 4. 백준 알고리즘 11022번 A + B - 8 c++ 요약 : Case를 입력 후 A와 B입력, A와B의 덧셈을 출력하는 문제 소스코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int C; cin >> C; for(int i=1;i> a >> b; cout 2020. 12. 4. 백준 알고리즘 10950번 A+B-3 c++ 요약 : CASE 값만큼 반복해서 두 수의 더한 값을 출력한다. 소스코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int C,a,b; cin >> C; int swap = C; while(C--) { cin >> a >> b; cout 2020. 12. 4. 백준 알고리즘 1000번 A+B c++ 요약 : A와 B값을 입력 후 A+B 출력 소스코드 1 2 3 4 5 6 7 8 9 10 #include using namespace std; int main(void) { int a,b; cin >> a >> b; cout 2020. 12. 3. 이전 1 다음 반응형