공부하는 히욤이

10430번 : 나머지 본문

Algorithm/BaekJoon

10430번 : 나머지

히욤이 2019. 2. 18. 22:54

10430번 : 나머지

문제 출처 : 백준 알고리즘


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.io.IOException;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) throws Exception, IOException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
 
        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);
 
    }
 
}
 
cs


'Algorithm > BaekJoon' 카테고리의 다른 글

9498번 : 시험 성적  (0) 2019.02.18
2558번 : A+B  (0) 2019.02.18
10869번 : 사칙연산  (0) 2019.02.18
1008번 : A/B  (0) 2019.02.18
2438번 : 별 찍기 - 1  (0) 2019.02.13