출제 링크 : https://www.acmicpc.net/problem/2741
2741번: N 찍기
자연수 N이 주어졌을 때, 1부터 N까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오.
www.acmicpc.net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Solution
{
class Program
{
static void Main(string[] args)
{
int Num = int.Parse(Console.ReadLine());
StringBuilder allNumbers = new StringBuilder();
for(int i = 1; i <= Num; i++)
{
int result = Num - (Num - i);
allNumbers.Append(result + "\n");
}
Console.Write(allNumbers.ToString());
}
}
}
'Baekjoon 문제풀이' 카테고리의 다른 글
[Baekjoon 3단계(7)] 11021번 : A+B - 7 (0) | 2021.08.31 |
---|---|
[Baekjoon 3단계(6)] 2742번 : 기찍 N (0) | 2021.08.31 |
[Baekjoon 3단계(4)] 15552번 : 빠른 A+B (0) | 2021.08.31 |
[Baekjoon 3단계(3)] 8393번 : 합 (0) | 2021.08.31 |
[Baekjoon 3단계(2)] 10950번 : A+B - 3 (0) | 2021.08.31 |