www.acmicpc.net/problem/10430

 

10430번: 나머지

첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000)

www.acmicpc.net

 

import java.util.Scanner;

public class BOJ_10430 {
    public static void main(String[] args) {
        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 );





    }
}

'- 코딩 공부 > Algorithm' 카테고리의 다른 글

타노스  (0) 2021.03.17
이상한 기호  (0) 2021.03.17
오늘 날짜  (0) 2021.03.17
  (0) 2021.03.17
A-B  (0) 2021.03.16

+ Recent posts