https://www.acmicpc.net/problem/11021
11021๋ฒ: A+B - 7
๊ฐ ํ ์คํธ ์ผ์ด์ค๋ง๋ค "Case #x: "๋ฅผ ์ถ๋ ฅํ ๋ค์, A+B๋ฅผ ์ถ๋ ฅํ๋ค. ํ ์คํธ ์ผ์ด์ค ๋ฒํธ๋ 1๋ถํฐ ์์ํ๋ค.
www.acmicpc.net
1. f-string ํจ์
' ' ์์ ๋ฌธ์๋ ๋ฌธ์์ด๋ก ์ถ๋ ฅ, { } ์์ ๋ฌธ์๋ ๋ณ์๊ฐ์ผ๋ก ์ถ๋ ฅ
t=int(input())
for i in range(t):
a,b=map(int,input().split())
print(f'Case #{i+1}: {a+b}')
2. ๋ฌธ์์ด ํฌ๋งคํ
t=int(input())
for i in range(t):
a,b=map(int,input().split())
print('Case #%d: %d'%(i+1,a+b))'๐ค > ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| ๋ฐฑ์ค 2577: ์ซ์์ ๊ฐ์ (Python) (0) | 2021.08.24 |
|---|---|
| ๋ฐฑ์ค 2562: ์ต๋๊ฐ (Python) (0) | 2021.08.24 |
| ๋ฐฑ์ค 10951: A+B - 4 (Python) (0) | 2021.08.19 |
| ๋ฐฑ์ค 10871: X๋ณด๋ค ์์ ์ (Python) (0) | 2021.08.19 |
| ๋ฐฑ์ค 15552: ๋น ๋ฅธ A+B (Python) (0) | 2021.08.19 |