hsminnnn

[백준 BAEK JOON] 10869번 사칙연산 ( C언어 ) 본문

백준 문제풀이

[백준 BAEK JOON] 10869번 사칙연산 ( C언어 )

hsminnnn 2022. 10. 28. 17:05

 

https://www.acmicpc.net/problem/10869

 

10869번: 사칙연산

두 자연수 A와 B가 주어진다. 이때, A+B, A-B, A*B, A/B(몫), A%B(나머지)를 출력하는 프로그램을 작성하시오. 

www.acmicpc.net

 

 

문제

 

 

 

소스 코드
#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\n",a%b);
    
    return 0;
}

 

 

결과

Comments