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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(같은 사용자의 중간 판 2개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;SWEA 1938 아주 간단한 계산기
{{SWEA|난이도=1}}
* 더하기(a+b), 빼기(a-b), 곱하기(a*b), 나누기(a/b) 결과를 차례로 출력한다.
* 더하기(a+b), 빼기(a-b), 곱하기(a*b), 나누기(a/b) 결과를 차례로 출력한다.
{{SWEA 헤더}}
{{SWEA 난이도 1-2}}
|}


==C++==
==C++==

2023년 8월 25일 (금) 01:42 기준 최신판

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 }}