ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป ๋ฌธ์ œ

 

10869๋ฒˆ: ์‚ฌ์น™์—ฐ์‚ฐ

๋‘ ์ž์—ฐ์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ด๋•Œ, A+B, A-B, A*B, A/B(๋ชซ), A%B(๋‚˜๋จธ์ง€)๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 

www.acmicpc.net


โœ๐Ÿป ํ’€์ด

๐ŸŽจ Go

package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	fmt.Println(a + b)
	fmt.Println(a - b)
	fmt.Println(a * b)
	fmt.Println(a / b)
	fmt.Println(a % b)
}

๐ŸŽจ Python3

import sys

a, b = sys.stdin.readline().split()
a = int(a)
b = int(b)

print(a+b)
print(a-b)
print(a*b)
print(int(a/b))
print(a%b)
728x90

'dev > algorithm' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

BOJ / 2588๋ฒˆ / ๊ณฑ์…ˆ [Go] [Python3]  (0) 2020.03.14
BOJ / 10430๋ฒˆ / ๋‚˜๋จธ์ง€ [Go] [Python3]  (0) 2020.03.14
BOJ / 1008๋ฒˆ / A/B [Go] [Python3]  (0) 2020.03.14
BOJ / 10998๋ฒˆ / Aร—B [Go] [Python3]  (0) 2020.03.13
BOJ / 1001๋ฒˆ / A-B [Go] [Python3]  (0) 2020.03.13
๋Œ“๊ธ€