Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- js
- 게임
- 동기
- Porject
- execCommand
- 혼프
- eport
- ajax
- Import
- json
- mysql
- webpack
- async
- JS #프로젝트
- sql
- Project
- addEventListener
- 참고블로그
- slow and steady
- setTimeout()
- 비동기
- database
- db
- promise
- object
- https://m.blog.naver.com/tt2t2am1118/221010125300
- await
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- prj
- callback
Archives
- Today
- Total
C-log
💡15552번 본문
728x90
import sys
T = int(input())
for i in range(T):
A, B = map(int, sys.stdin.readline().split())
print(A+B)
input을 사용하지 않고 import sys를 통해서 값을 받아 올 수 있다. testcase는 기존의 input으로 작성해도 런타임, 시간초과가 일어 나지 않는다.
testcase T변수를 input이 아닌 sys.stdin.readline()으로 작성하면 아래와 같다.
import sys
# T = int(input())
T = int(sys.stdin.readline().strip()) # strip()함수를 사용함으로 개행문자 /n을 제거할 수 있다.
for i in range(T):
A, B = map(int, sys.stdin.readline().split())
print(A+B)
아래는 참고하면 좋은 글이다.
[Python 문법] 파이썬 입력 받기(sys.stdin.readline)
파이썬으로 코딩 테스트를 준비한다면, 반드시 알아야 할 입력방식인 sys.stdin.readline()에 대한 정리 입니다.
velog.io
728x90
Comments