https://www.acmicpc.net/problem/10869
Python
a, b = map(int, input().split())
print(a+b, a-b, a*b, a//b, a%b, sep='\n')
Java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[] s = scan.nextLine().split(" ");
int n1 = Integer.parseInt(s[0]);
int n2 = Integer.parseInt(s[1]);
System.out.println(n1 + n2);
System.out.println(n1 - n2);
System.out.println(n1 * n2);
System.out.println(n1 / n2);
System.out.println(n1 % n2);
scan.close();
}
}
'알고리즘 > 백준' 카테고리의 다른 글
[Python/Java] 백준 2588번 - 곱셈 (0) | 2020.06.08 |
---|---|
[Python/Java] 백준 10430번 - 나머지 (0) | 2020.06.08 |
[Python/Java] 백준 1008번 - A/B (0) | 2020.06.08 |
[Python/Java] 백준 10998번 - A×B (0) | 2020.06.08 |
[Python/Java] 백준 1001번 - A-B (0) | 2020.06.08 |
댓글