※ 글쓴이는 취미로 코딩을 익혀보는 사람이라 정확하지 않은 내용을 담고 있을 수 있다 ※
이번에 볼 문제는 백준 26574번 문제인 Copier이다.
문제는 아래 링크를 확인하자.
https://www.acmicpc.net/problem/26574
26574번: Copier
Your copier broke down last week, and you need to copy a list of numbers for a class project due tomorrow! Luckily, you can use your computer to copy the numbers for you. Given a list of numbers, each on their own line, print out the number, a space, and t
www.acmicpc.net
주어지는 각 수 x를 입력받아 각 줄에 공백을 사이에 두고 2회 출력, 즉 "x x"꼴로 출력하는 문제이다.
지문에 구체적으로 주어져있지는 않지만, 부호있는 32비트 정수 자료형으로 각 정수를 입력받아 출력하는 것으로도 문제를 충분히 통과할 수 있음을 확인했다. (아래의 제출 소스코드)
아래는 제출한 소스코드이다.
#include <iostream>
using namespace std;
int T;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> T;
while (T--) {
int x; cin >> x;
cout << x << ' ' << x << '\n';
}
}
728x90
'BOJ' 카테고리의 다른 글
[BOJ 26532 // C++] Acres (0) | 2022.12.19 |
---|---|
[BOJ 2387 // Algol 68] Howl (0) | 2022.12.19 |
[BOJ 5300 // C++] Fill the Rowboats! (0) | 2022.12.19 |
[BOJ 26500 // C++] Absolutely (0) | 2022.12.19 |
[BOJ 26575 // C++] Pups (0) | 2022.12.19 |