[백준] 10430번 : 나머지 - Java(자바)

강재원·2022년 10월 6일
0

[코딩테스트] Java

목록 보기
101/200



https://www.acmicpc.net/problem/10430

import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
      Scanner s=new Scanner(System.in);
      int a=s.nextInt();
      int b=s.nextInt();
      int c=s.nextInt();
      
      System.out.format("%d\n",(a+b)%c);
      System.out.format("%d\n",((a%c)+(b%c))%c);
      System.out.format("%d\n",(a*b)%c);
      System.out.format("%d\n",((a%c)*(b%c))%c);
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글