[백준] 10430. 나머지(브론즈5)

ERror.ASER·2021년 3월 19일
0

백준

목록 보기
38/69
post-thumbnail

백준(브론즈5) - 10430. 나머지(브론즈5)



풀이

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//첫째 줄에 (A+B)%C, 둘째 줄에 ((A%C) + (B%C))%C, 셋째 줄에 (A×B)%C, 넷째 줄에 ((A%C) × (B%C))%C를 출력한다.
		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);
	}
}
profile
지우의 블로그

0개의 댓글