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;
using System.Threading.Tasks;
 
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
 

'C# > Study' 카테고리의 다른 글

박싱과 언박싱  (0) 2019.10.31
배열 내 요소중 최대값 구하기  (0) 2019.10.15
성적표만들기  (0) 2019.09.27
1차원 배열  (0) 2019.09.24
문자열 표현방식  (0) 2019.09.19
: