728x90
출처-https://www.acmicpc.net/problem/10430
728x90
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.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);
}
}
728x90
'Problem Solving > BOJ' 카테고리의 다른 글
[백준, BOJ 1330] 두 수 비교하기 (java) (0) | 2020.08.20 |
---|---|
[백준, BOJ 2588] 곱셈 (java) (0) | 2020.08.20 |
[백준, BOJ 10869] 사칙연산 (java) (0) | 2020.08.20 |
[백준, BOJ 1008] A/B (java) (0) | 2020.08.20 |
[백준, BOJ 10998] AxB (java) (0) | 2020.08.20 |