풀이
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class B10430 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] split = br.readLine().split(" ");
int A = Integer.parseInt(split[0]);
int B = Integer.parseInt(split[1]);
int C = Integer.parseInt(split[2]);
sb.append((A + B) % C).append("\n");
sb.append(((A % C) + (B % C)) % C).append("\n");
sb.append((A * B) % C).append("\n");
sb.append(((A % C) * (B % C)) % C).append("\n");
System.out.println(sb);
}
}
'Algorithm' 카테고리의 다른 글
수학 / 백준 1934 최소공배수 (0) | 2025.04.16 |
---|---|
수학 / 백준 2609 최대공약수와 최소공배수 (0) | 2025.04.14 |
자료구조 / 백준 17299 오등큰수 (0) | 2025.04.11 |
자료구조 / 백준 17298 오큰수 (0) | 2025.04.09 |
자료구조 / 백준 10799 쇠막대기 (0) | 2025.04.08 |