반응형
문제 이해
더보기
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
반응형
'Algorithm > SWEA' 카테고리의 다른 글
[SWEA] 2027. 대각선 출력하기 D1 JAVA (0) | 2021.03.16 |
---|---|
[SWEA] 2025. N줄덧셈 D1 JAVA (0) | 2021.03.16 |
[SWEA] 1933. 간단한 N 의 약수 D1 JAVA (0) | 2021.03.16 |
[SWEA] 1936. 1대1 가위바위보 D1 JAVA (0) | 2021.03.16 |
[SWEA] 2019. 더블더블 D1 JAVA (0) | 2021.03.16 |