https://www.acmicpc.net/problem/10430
10430번: 나머지
첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000)
www.acmicpc.net
#include <iostream>
using namespace std;
int main(){
int a,b,c;
cin >> a>>b>>c;
cout << (a+b)%c <<endl;
cout << (a%c+b%c)%c<<endl;
cout << (a*b)%c <<endl;
cout << (a%c*b%c)%c <<endl;
return 0;
}
'OnlineJudge' 카테고리의 다른 글
Baek Joon Algorithm(백준 알고리즘): 10869번 (0) | 2019.08.27 |
---|---|
Baek Joon Algorithm(백준 알고리즘): 10828번 (0) | 2019.08.27 |
Baek Joon Algorithm(백준 알고리즘): 2884번 (0) | 2019.08.27 |
Baek Joon Algorithm(백준 알고리즘): 2753번 (0) | 2019.08.27 |
Baek Joon Algorithm(백준 알고리즘): 2588번 (0) | 2019.08.27 |