남영운 :: 남영운

'전체 글'에 해당되는 글 91건

  1. 2019.09.19 문자열 ->숫자로 변환 입력하여 구구단(19.09.19)
  2. 2019.09.19 줄넘기 횟수 (19.09.19)
  3. 2019.09.19 Hello World 10번찍기/날짜 /구구단/별찍기1~3 (19.09.19)

문자열 ->숫자로 변환 입력하여 구구단(19.09.19)

Console(콘솔)/실습 2019. 9. 19. 15:35
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax02
{
    class Program
    {
        static void Main(string[] args)
        {
           
             Console.Write("구구단 중에 원하는 단을 입력해주세요.");
             string name = Console.ReadLine();
 
             int a = int.Parse(name);
            
            for(int b = 1;b<10;b++)
            {
                Console.WriteLine(a +"X" + b +"=" + a*b);
            }
        }
        
    }
}
 
:

줄넘기 횟수 (19.09.19)

Console(콘솔)/실습 2019. 9. 19. 15:30
1
2
3
4
5
6
7
8
            Console.Write("줄넘기를 몇번 하시겠습니까? ");
            string a = Console.ReadLine();
            int b = int.Parse(a);
            for (int c = 1; c <= 3; c++)
            {
                Console.WriteLine(c + "회 줄넘기를 했습니다.");
            }
            Console.WriteLine("줄넘기를 마쳤습니다.");
 

:

Hello World 10번찍기/날짜 /구구단/별찍기1~3 (19.09.19)

Console(콘솔)/실습 2019. 9. 19. 11:33
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
83
84
85
86
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax01
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("***Hello World! 10번 치기***");
            for (int a = 1; a <= 10; a++)
            {            
                Console.WriteLine("Hello World!");
            }
            Console.WriteLine("");
            Console.WriteLine("***날짜***");
            for (int a = 1; a <= 12; a++)
            {
                Console.Write(a);
                Console.WriteLine("월");
            }
            Console.WriteLine("");
            Console.WriteLine("***구구단 2단***");
            for (int i = 1; i < 10; i++)
            {
                int a = 2;
                Console.Write(a);
                Console.Write(" X ");
                Console.Write(i);
                Console.Write(" = ");
                Console.WriteLine(a * i);
            }
            Console.WriteLine("");
            Console.WriteLine("***별찍기***");
            for (int a = 0; a < 5; a++)
            {
                Console.WriteLine("*");
                for (; a < 4; a++)
                {
                    Console.WriteLine("**");
                    for (; a < 3; a++)
                    {
                        Console.WriteLine("***");
                        for (; a < 2; a++)
                        {
                            Console.WriteLine("****");
                            for (; a < 1; a++)
                            {
                                Console.WriteLine("*****");
                            }
                        }
                    }
                }
            }
            Console.WriteLine("");
            Console.WriteLine("***별찍기2***");
            for(int a = 1;a<5;a++)
            {
                Console.WriteLine("   *");
                for(;a<4;a++)
                {
                    Console.WriteLine("  **");
                    for(;a<3;a++)
                    {
                        Console.WriteLine(" ***");
                        for(;a<2;a++)
                        {
                            Console.WriteLine("****");
                        }
                    }
                }
            }
            Console.WriteLine("");
            Console.WriteLine("*** 별찍기3 ***");
            for(int a = 0;a<5;a++)
            {
                Console.WriteLine("*****");
            }
 
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
 

: