09.23 Row와 Column 설정하기
C#/Study 2019. 9. 23. 17:21예제:

코드:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Syntax07
{
class Program
{
static void Main(string[] args)
{
Console.Write("Row값을 입력하세요: ");
string strX = Console.ReadLine();
int x = Convert.ToInt32(strX);
Console.Write("Col값을 입력하세요: ");
string strY = Console.ReadLine();
int y = Convert.ToInt32(strY);
for (int c = 0; c<x; c++)
{
for (int i =0; i<y; i++)
{
Console.Write($"({i},{c})\t");
}
Console.WriteLine();
}
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|