본문 바로가기

Algorithm/SWEA

[SWEA] 1938. 아주 간단한 계산기 D1 JAVA

반응형


문제 이해

더보기

4칙 연산을 출력해보는 문제

 

아이디어

더보기

4칙 연산을 출력하자

 

코드

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 a= sc.nextInt();
		int b= sc.nextInt();
		sc.close();
		
		//1.+
		System.out.println(a+b);
		//2.-
		System.out.println(a-b);
		//3.*
		System.out.println(a*b);
		//4./
		System.out.println(a/b);
	}
}

 

 


 

 

집사는개발자가되고파

 

choppadontbiteme.tistory.com

 

반응형