

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include <iostream> using namespace std; int main() { int A, B, C = 0; while (1) { cin >> A >> B >> C; if (2 <= A && 2 <= B && 2 <= C && A <= 10000 && B <= 10000 && C <= 10000) break; } 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 |