본문 바로가기

Algorithm

백준(baekjoon)(BaekJoon)코딩 10430번:나머지 답

반응형
1
2
3
4
5
6
7
8
9
10
11
12
#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;
}
 
cs