-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathp10430.java
More file actions
23 lines (21 loc) · 734 Bytes
/
p10430.java
File metadata and controls
23 lines (21 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.*;
import java.util.*;
public class p10430 {
static int a, b, c;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
c = Integer.parseInt(st.nextToken());
int w, x, y, z = 0;
w = (a + b) % c;
x = ((a % c) + (b % c)) % c;
y = (a * b) % c;
z = ((a % c) * (b % c)) % c;
System.out.println(w);
System.out.println(x);
System.out.println(y);
System.out.println(z);
}
}