728x90
문제 링크: https://www.acmicpc.net/problem/10869
10869번: 사칙연산
두 자연수 A와 B가 주어진다. 이때, A+B, A-B, A*B, A/B(몫), A%B(나머지)를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
문제 풀이
사칙연산을 하면 되는 문제.
코드
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRT_SECURE_NO_WARININGS | |
#include <stdio.h> | |
int main() | |
{ | |
int num1, num2; | |
scanf("%d %d", &num1, &num2); | |
printf("%d\n%d\n%d\n%d\n%d\n", num1 + num2, num1 - num2, num1 * num2, num1 / num2, num1 % num2); | |
return 0; | |
} |
728x90
'BOJ' 카테고리의 다른 글
[BOJ][Python] 백준 10172번 - 개 (0) | 2022.05.05 |
---|---|
[BOJ][C] 백준 10430번 - 나머지 (0) | 2022.05.05 |
[BOJ][Python] 백준 23796번 - 2,147,483,648 게임 (0) | 2022.05.03 |
[BOJ][C] 백준 10998번 - A×B (0) | 2022.05.03 |
[BOJ][Python] 백준 10718번 - We love Kriii (0) | 2022.05.03 |