#include <iostream>
using namespace std;
class func{
int A,B,C;
public :
void input(){ cin >> A >> B >> C; }
void operation(){
cout << (A+B)%C << endl;
cout << ((A%C) + (B%C)) %C << endl;
cout << (A*B)%C << endl;
cout << ((A%C) * (B%C))%C << endl;
}
};
int main(){
func ABC;
ABC.input();
ABC.operation();
}
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
180301_1931_회의실 배정 (0) | 2018.03.01 |
---|---|
180301_1920_수 찾기 (0) | 2018.03.01 |
180227_1008_A/B (0) | 2018.02.27 |
180227_10172_개 (0) | 2018.02.27 |
180217_2660_회장뽑기 (0) | 2018.02.17 |