Home [1일 1문제] 3월 14일 문제풀이
Post
Cancel

[1일 1문제] 3월 14일 문제풀이

✏️백준 10430번 : 나머지

문제

나의 풀이

- Swift

1
2
3
4
5
6
7
8
9
let nums = readLine()!.split(separator: " ").map{ Int(String($0))! }
let a = nums[0]
let b = nums[1]
let c = nums[2]

print((a+b) % c)
print(((a%c) + (b%c)) % c)
print((a*b) % c)
print(((a%c) * (b%c)) % c)

- Python

1
2
3
4
5
6
7
8
9
10
import sys

input = sys.stdin.readline

a, b, c = map(int, input().strip().split())

print((a+b) % c)
print(((a%c) + (b%c)) % c)
print((a*b) % c)
print(((a%c) * (b%c)) % c)
This post is licensed under CC BY 4.0 by the author.