A와 B라는 값을 입력받고 각각 연산하여 값을 출력하면 끝이 난다.
A+B
#include <iostream>
int main(){
short int a, b;
std::cin >> a >> b;
std::cout << a + b;
return 0;
}
A-B
#include <iostream>
int main()
{
int a, b;
std::cin >> a >> b;
std::cout << a-b;
return 0;
}
A*B
#include <iostream>
int main()
{
int a, b;
std::cin >> a >> b;
std::cout << a*b;
return 0;
}
'프로그래밍 일지 > C++' 카테고리의 다른 글
백준 10172) 개 (0) | 2022.01.28 |
---|---|
백준 10171) 고양이 (0) | 2022.01.28 |
백준 10718) We love kriii (0) | 2022.01.28 |
백준 2557) Hello World (0) | 2022.01.28 |
백준 1006 습격자 초라기 (0) | 2022.01.24 |
댓글