백준 BOJ C# 2739 구구단
2020. 1. 10. 15:31ㆍ백준 알고리즘 단계별/for 문
반응형
출제 링크 : https://www.acmicpc.net/problem/2739
2739번: 구구단
N을 입력받은 뒤, 구구단 N단을 출력하는 프로그램을 작성하시오. 출력 형식에 맞춰서 출력하면 된다.
www.acmicpc.net
코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
using System;
using static System.Console;
namespace baekjoon
{
class Program
{
static void Main(string[] args)
{
string inputNum = Console.ReadLine();
int num = int.Parse(inputNum);
for (int i = 1; i <= 9; i++)
{
WriteLine($"{num} * {i} = {num * i}");
}
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
반응형