Information Security Study
[백준] 10869: 사칙연산 본문
사칙연산이 가능한 코드를 작성하는 문제이다.
입출력 예시이다.
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",a+b);
printf("%d\n",a-b);
printf("%d\n",a*b);
printf("%d\n",a/b);
printf("%d",a%b);
return 0;
}
두 정수를 입력 받고 총 다섯줄의 사칙연산 결과를 출력하도록 했다.
/n으로 줄바꿈을 했다.
이때 %연산은 정수 계열 형식으로 출력해야만 한다.
'Programming > C' 카테고리의 다른 글
[백준] 18108: 1998년생인 내가 태국에서는 2541년생?! (0) | 2023.10.06 |
---|---|
[백준] 10926: ??! (0) | 2023.09.24 |
[백준] 1008: A/B (0) | 2023.08.22 |
[백준] 10998: AxB (0) | 2023.08.21 |
[백준] 1001: A-B (0) | 2023.08.21 |