10430번: 나머지
첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000)
www.acmicpc.net
#include <iostream>
using namespace std;
auto main()->int {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
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;
}
'Problem set' 카테고리의 다른 글
[백준] 10818: 최소, 최대 (0) | 2020.12.29 |
---|---|
[백준] 10799: 쇠막대기 (0) | 2020.12.29 |
[백준] 9613: GCD 합 (0) | 2020.12.29 |
[백준] 9095: 1, 2, 3 더하기 (0) | 2020.12.29 |
[백준] 9093: 단어 뒤집기 (0) | 2020.12.29 |