elesis's haunt
10430 나머지 본문
import java.util.Scanner;
public class Main {
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 );
}
}
'백준~문풀 후 최적화 추가~ > 단계별로 풀어보기' 카테고리의 다른 글
1330 두 수 비교하기 (0) | 2021.04.14 |
---|---|
2588 곱셈 (0) | 2021.04.14 |
10869 사칙연산 (0) | 2021.04.14 |
1000 A+B, 1001 A-B 10998 A*B 1008 A/B (0) | 2021.04.10 |
10172 개 (0) | 2021.04.10 |
Comments