본문 바로가기

C#/과제

2020-04-03 과제

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Study_002
{
    class App
    {
        public App()
        {
            
//이중반복문
 
            /*
            for (int i = 0; i < 3; i++) {
 
                for (int j = 0; j < 3; j++) {
                    Console.WriteLine("홍길동");
                }
                Console.WriteLine("\r");
            }
            */
 
            /*
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Console.Write("*");
                }
                Console.Write("\n");
            }
            */
 
            /*
             * 
            for (int i = 1; i < 6; i++)
            {
                for (int j = 1; j < i+1; j++)
                {
                    Console.Write("*");                
                }
                Console.Write("\n");
            }
            */
 
            /*
 
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5-i; j++)
                {
                    Console.Write("*");
                }
                Console.Write("\n");
            }
 
            */
 
 
            int num = 5;
 
            for (int i = 0; i < num; i++)
            {
                for (int j = num - 1; j > i; j--)
                {
                    Console.Write(" ");
                }
 
                for (int j = 0; j < 2 * i + 1; j++)
                {
                    Console.Write("*");
                }
                Console.Write("\n");
            }
 
 
        }
    }
}
 
 

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

2020-04-17 과제  (0) 2020.04.19
2020-04-14 과제  (0) 2020.04.15
2020-04-10 과제 완료. Source code  (0) 2020.04.12
2020-04-10 과제 문제 및 진행단계 기록  (0) 2020.04.10
2020.04.02 과제  (0) 2020.04.02