"SWEA 1938 아주 간단한 계산기"의 두 판 사이의 차이

37번째 줄: 37번째 줄:


==같이 보기==
==같이 보기==
* [[SWEA-2025 N줄덧셈]]
* [[SWEA 2025 N줄덧셈]]
* [[SWEA-2046 스탬프 찍기]]
* [[SWEA 2046 스탬프 찍기]]
* [[SWEA-2072 홀수만 더하기]]
* [[SWEA 2072 홀수만 더하기]]
* [[SWEA-2071 평균값 구하기]]
* [[SWEA 2071 평균값 구하기]]

2019년 1월 14일 (월) 23:15 판

1 개요

SWEA 1938 아주 간단한 계산기
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 1-2

2 C++

#include <iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    cout << a+b << endl;
    cout << a-b << endl;
    cout << a*b << endl;
    cout << a/b << endl;
}

3 Java

import java.util.Scanner;
class Solution {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);
    }
}

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}