2742번 - 기찍 N
문제
자연수 N이 주어졌을 때, N부터 1까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오.
입력
첫째 줄에 100,000보다 작거나 같은 자연수 N이 주어진다.
출력
첫째 줄부터 N번째 줄 까지 차례대로 출력한다.
문제 링크
https://www.acmicpc.net/problem/2742
난이도: 브론즈 4
C++를 사용한 풀이
#include <iostream>
using namespace std;
int main(void){
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
for(int i=n-1;i>=0;--i){
cout<<i+1<<"\n";
}
return 0;
}
댓글남기기