반응형
문제 : https://www.acmicpc.net/problem/10430
풀이과정
입출력은 iostream의 cin, cout 사용
전체코드(C++14)
#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;
}
최근댓글