SWEA 1938 아주 간단한 계산기

1 개요[ | ]

SWEA 1938 아주 간단한 계산기

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 Python[ | ]

#kcy
a, b = map(int, input().split())
print(a+b)
print(a-b)
print(a*b)
print(int(a/b))
a, b = map(int, input().split())
print(a+b)
print(a-b)
print(a*b)
print(a//b)

5 같이 보기[ | ]

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