본문으로 바로가기

출제 링크 : 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());
        }
    }
}