https://www.acmicpc.net/problem/10430
풀이
import java.util.Scanner;
public class bj10430 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
sc.close();
System.out.println((a+b)%c);
System.out.println(((a%c) + (b%c))%c);
System.out.println((a*b)%c);
System.out.println(((a%c) * (b%c))%c);
}
}
'Algorithm > BOJ' 카테고리의 다른 글
[BOJ] 백준 1330(두 수 비교하기) -Java (0) | 2022.06.23 |
---|---|
[BOJ] 백준 2588(곱셈) -Java (0) | 2022.06.23 |
[BOJ] 백준 10926(??!) -Java (0) | 2022.06.23 |
[BOJ] 백준 10869(사칙연산) -Java (0) | 2022.06.23 |
[BOJ] 백준 1008(A/B) -Java (0) | 2022.06.23 |