๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
SWEA

[SWEA] 1938. ์•„์ฃผ ๊ฐ„๋‹จํ•œ ๊ณ„์‚ฐ๊ธฐ

by JulesJ 2022. 5. 18.
728x90

 

1938. ์•„์ฃผ ๊ฐ„๋‹จํ•œ ๊ณ„์‚ฐ๊ธฐ - D1

 

๋‘ ์ˆซ์ž๋ฅผ ๋ฐ›์•„ ์‚ฌ์น™์—ฐ์‚ฐ(+, -, *, /)์„ ์ˆœ์„œ๋Œ€๋กœ ํ•˜๊ณ  ์ถœ๋ ฅํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค.

 

num1, num2๋ฅผ ์ž…๋ ฅ๋ฐ›๊ณ  +, -, *, / ์ˆœ์„œ๋Œ€๋กœ ์—ฐ์‚ฐํ•œ ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋„๋ก ํ–ˆ๋‹ค.

 

 

import java.util.Scanner;
import java.io.FileInputStream;

class Solution
{
	public static void main(String args[]) throws Exception
	{

		Scanner sc = new Scanner(System.in);
		int num1 = sc.nextInt();
		int num2 = sc.nextInt();

		System.out.println(num1+num2);
		System.out.println(num1-num2);
		System.out.println(num1*num2);
 		System.out.println(num1/num2);
	}
}

 

 

๋ ๐Ÿง

 

 

๋Œ“๊ธ€