반응형
https://www.acmicpc.net/problem/1000
1000번: A+B
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
답
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int a,b;
cin>>a>>b;
cout<<a+b;
return 0;
}
1. 변수
- 'a': 입력받는 첫번째 정수이다.
- 'b': 입력받는 두번째 정수이다.
2. 입력
- 사용자가 입력한 값을 각각 'a'와 'b'에 저장한다.
3. 출력
- a+b를 출력한다.
참고
https://iloveprogramming.tistory.com/115
[c++]
https://iloveprogramming.tistory.com/114 [c++] #include '#include ' 'c++'의 표준 라이브러리의 모든 헤더파일을 포함하는 비표준 헤더파일이다. 이 헤더파일을 사용하면 개발자는 모든 표준 라이브러리의 모든
iloveprogramming.tistory.com
끝
반응형
'c++ > 백준' 카테고리의 다른 글
[백준] 2439번 별 찍기 - 2(c++) (0) | 2023.12.23 |
---|---|
[백준] 2438번 별 찍기 - 1(c++) (2) | 2023.12.23 |
[백준] 9086번 문자열(c++) (0) | 2023.12.23 |
[백준] 1008번 A/B(c++) (0) | 2023.12.23 |
[백준] 1001번 A-B(c++) (0) | 2023.12.23 |