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

  1. 2019.09.25 10718 강한친구 대한육군
  2. 2019.09.25 2557 Hello World!
  3. 2019.09.25 알람 시계
  4. 2019.09.23 상품 목록(3)
  5. 2019.09.23 상품 목록(2)
  6. 2019.09.23 상품 목록(1)
  7. 2019.09.20 9.20
  8. 2019.09.20 9.20
  9. 2019.09.20 9.20
  10. 2019.09.20 Console.ReadLine();

10718 강한친구 대한육군

Console/Algorithm 2019. 9. 25. 16:31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("강한친구 대한육군");
            Console.WriteLine("강한친구 대한육군");
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

9655 돌 게임  (0) 2019.09.26
10998 A x B  (0) 2019.09.25
1001 A-B  (0) 2019.09.25
1000 A+B  (0) 2019.09.25
2557 Hello World!  (0) 2019.09.25

2557 Hello World!

Console/Algorithm 2019. 9. 25. 16:29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

9655 돌 게임  (0) 2019.09.26
10998 A x B  (0) 2019.09.25
1001 A-B  (0) 2019.09.25
1000 A+B  (0) 2019.09.25
10718 강한친구 대한육군  (0) 2019.09.25

알람 시계

Console/실습 2019. 9. 25. 16:07
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax08
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] arr = input.Split(' ');
            int a = int.Parse(arr[0]);
            int b = int.Parse(arr[1]);
            if (24 > a)
            {
                if (0<= a)
                {
                    if (60 >= b)
                    {
                        if (0 <= b && b <= 15)
                        {
                            Console.WriteLine($"{a - 1} {b + 15}");
                        }
                        else if (0 == a)
                        {
                            Console.WriteLine($"{a+23} {b + 15}");
                        }
                        else if (b >= 15)
                        {
                            if (b > 44)
                            {
                                Console.WriteLine($"{a} {b - 45}");
                            }
                            else if (b <= 44)
                            {
                                Console.WriteLine($"{a - 1} {b + 15}");
                            }
                        }
                    }
                }
            }
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > 실습' 카테고리의 다른 글

swich 문 (2)  (0) 2019.09.26
swich 문 (1)  (0) 2019.09.26
상품 목록(3)  (0) 2019.09.23
상품 목록(2)  (0) 2019.09.23
상품 목록(1)  (0) 2019.09.23

상품 목록(3)

Console/실습 2019. 9. 23. 19:14
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
87
88
89
90
91
92
93
94
95
96
97
98
99
 string a = "장검";
            string b = "단검";
            string c = "활";
            string d = "도끼";
            int goldNow = 5000;
            int priceLongSword = 800;
            int priceShortSword = 550;
            int priceBow = 760;
            int priceAxe = 810;
            int countLongSword = 0;
            int countShortSword = 0;
            int countBow = 0;
            int countAxe = 0
 
            for (int i = 0; i >= 0; i++)
            {
                Console.WriteLine("-------------------------------------");
                Console.WriteLine("금화 : " + goldNow);
                Console.WriteLine("-------------------------------------");
                Console.WriteLine("상품 목록");
                Console.WriteLine("-------------------------------------");
                Console.WriteLine("1.장검 : " + priceLongSword);
                Console.WriteLine("2.단검 : " + priceShortSword);
                Console.WriteLine("3.활 : " + priceBow);
                Console.WriteLine("4.도끼 : " + priceAxe);
                Console.WriteLine("-------------------------------------");
                Console.WriteLine("상점에서 구입하고자 하는 아이템을 입력하세요.");
                string input = Console.ReadLine();
                Console.WriteLine(input + "을 구매했습니다.");
                Console.WriteLine("-------------------------------------");
                {
                    if (input == a)
                    {
                        if (goldNow - priceLongSword > 0)
                        {
                            Console.Clear();
                            Console.WriteLine(input + "을 구매했습니다.(-" + priceLongSword + ")");
                            goldNow = goldNow - priceLongSword;
                            Console.WriteLine("금화 : " + goldNow);
                        }
                        else
                        {
                            Console.Clear();
                            Console.WriteLine("금화가 부족합니다");
                        }
                    }
                    else if (input == b)
                    {
                        if (goldNow - priceShortSword > 0)
                        {
                            Console.Clear();
                            Console.WriteLine(input + "을 구매했습니다.(-" + priceShortSword + ")");
                            goldNow = goldNow - priceShortSword;
                            Console.WriteLine("금화 : " + goldNow);
                        }
                        else
                        {
                            Console.Clear();
                            Console.WriteLine("금화가 부족합니다.");
                        }
                    }
                    else if (input == c)
                    {
                        if (goldNow - priceBow > 0)
                        {
                            Console.Clear();
                            Console.WriteLine(input + "을 구매했습니다.(-" + priceBow + ")");
                            goldNow = goldNow - priceBow;
                            Console.WriteLine("금화 : " + goldNow);
                        }
                        else
                        {
                            Console.WriteLine("금화가 부족합니다.");
                        }
                    }
                    
                   
                    else if (input == d)
                    {
                        if (goldNow - priceAxe > 0)
                        {
                            Console.Clear();
                            Console.WriteLine(input + "을 구매했습니다.(-" + priceAxe + ")");
                            goldNow = goldNow - priceAxe;
                            Console.WriteLine("금화 : " + goldNow);
                        }
                        else
                        {
                            Console.Clear();
                            Console.WriteLine("금화가 부족합니다.");
                        }
                    }
                    else
                    {
                        Console.WriteLine(input+"는 없는 물건입니다.");
                    }
                    Console.WriteLine("-------------------------------------");
                }
            }
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > 실습' 카테고리의 다른 글

swich 문 (1)  (0) 2019.09.26
알람 시계  (0) 2019.09.25
상품 목록(2)  (0) 2019.09.23
상품 목록(1)  (0) 2019.09.23
9.20  (0) 2019.09.20

상품 목록(2)

Console/실습 2019. 9. 23. 17:48
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
            string a = "장검";
            string b = "단검";
            string c = "활";
            string d = "도끼";
            int goldNow = 5000;
            int priceLongSword = 800;
            int priceShortSword = 550;
            int priceBow = 760;
            int priceAxe = 810;
            Console.WriteLine("-------------------------------------");
            Console.WriteLine("금화 : " + goldNow);
            Console.WriteLine("-------------------------------------");
            Console.WriteLine("상품 목록");
            Console.WriteLine("-------------------------------------");
            Console.WriteLine("1.장검 : " + priceLongSword);
            Console.WriteLine("2.단검 : " + priceShortSword);
            Console.WriteLine("3.활 : " + priceBow);
            Console.WriteLine("4.도끼 : " + priceAxe);
            Console.WriteLine("-------------------------------------");
            Console.WriteLine("상점에서 구입하고자 하는 아이템을 입력하세요.");
            string input = Console.ReadLine();
            Console.WriteLine(input + "을 구매했습니다.");
            Console.WriteLine("-------------------------------------");
 
                if (input == a)
                {
                    Console.WriteLine(input + "을 구매했습니다.(-" + priceLongSword + ")");
                    goldNow = goldNow - priceLongSword;
                    Console.WriteLine("금화 : " + goldNow);
                }
                else if (input == b)
                {
                    Console.WriteLine(input + "을 구매했습니다.(-" + priceShortSword + ")");
                    goldNow = goldNow - priceShortSword;
                    Console.WriteLine("금화 : " + goldNow);
                }
                else if (input == c)
                {
                    Console.WriteLine(input + "을 구매했습니다.(-" + priceBow + ")");
                    goldNow = goldNow - priceBow;
                    Console.WriteLine("금화 : " + goldNow);
                }
                else if (input == d)
                {
                    Console.WriteLine(input + "을 구매했습니다.(-" + priceAxe + ")");
                    goldNow = goldNow - priceAxe;
                    Console.WriteLine("금화 : " + goldNow);
                }
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

 

'Console > 실습' 카테고리의 다른 글

알람 시계  (0) 2019.09.25
상품 목록(3)  (0) 2019.09.23
상품 목록(1)  (0) 2019.09.23
9.20  (0) 2019.09.20
9.19  (0) 2019.09.19

상품 목록(1)

Console/실습 2019. 9. 23. 17:17
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
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
 
 
            Console.WriteLine("*** 상점 ***");
            Console.WriteLine("[장검, 단검, 활, 도끼]");
            Console.WriteLine("");
            Console.WriteLine("상점에서 구입 하고자 하는 아이템을 입력해주세요. ");
            string input = Console.ReadLine();
            string a = "장검";
            string b = "단검";
            string c = "활";
            string d = "도끼";
            if(input == a)
            {
                Console.WriteLine(input + "을 구매했습니다.");
            }
            else if (input == b)
            {
                Console.WriteLine(input + "을 구매했습니다.");
            }
            else if (input == c)
            {
                Console.WriteLine(input + "을 구매했습니다.");
            }
            else if (input == d)
            {
                Console.WriteLine(input + "을 구매했습니다.");
            }
            else
            {
                Console.WriteLine("해당상품" + input + "는 없습니다.");
            }
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
cs
 

 

'Console > 실습' 카테고리의 다른 글

상품 목록(3)  (0) 2019.09.23
상품 목록(2)  (0) 2019.09.23
9.20  (0) 2019.09.20
9.19  (0) 2019.09.19
9.19  (0) 2019.09.19

9.20

Console/Problems 2019. 9. 20. 17:02

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

87

88

89

90

91

92

93

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace Syntax04

{

class Program

{

static void Main(string[] args)

{

//Console.WriteLine("Syntax04");

//char a = 'A';

//Console.WriteLine("a:"+a);

//char ch1 = '1';

//Console.WriteLine("ch1:" + ch1);

//string str = "test string";

//Console.WriteLine("str:" + str);

////char ch88 = (char)88;

//char ch88 = (char)88;

//Console.WriteLine(ch88);

//s/*tring str = (string)1;*/

//int b = int.Parse("1");

//string str1 = 1.ToString();

//string str2 = 1+"";

 

//int c = (int)3.5f;

//float f = (float)3;

//float f2 = (float)3.0;

//double d = (double)3.0f;

//char chA = 'a';

//string strA = "a";

//bool b = chA.ToString() == strA;

//Console.WriteLine(b);

//Console.Write("키를 입력해주세요.");

//ConsoleKeyInfo keyInfo = Console.ReadKey();

 

//bool isTrue = keyInfo.KeyChar.ToString() == "a";

//Console.WriteLine(isTrue);

 

//Console.WriteLine(keyInfo.KeyChar+","+keyInfo.Key);

//string input =Console.ReadLine();

 

//ConsoleKeyInfo keyInfo =Console.ReadKey();

//char c = keyInfo.KeyChar;

//Console.Clear();

//Console.WriteLine(c);

//ConsoleKeyInfo info=Console.ReadKey();

 

 

//Console.Clear();

//if (info.KeyChar == 'a')

//{

// Console.WriteLine("참");

//}

//else

//{

// Console.WriteLine("거짓");

//}

 

Console.Write("줄넘기를 하려면 D키를 입력 해주세요.");

ConsoleKeyInfo info = Console.ReadKey();

Console.Clear();

if (info.KeyChar == 'd')

{

Console.WriteLine("몇회 줄넘기를 할건가요?");

string a = Console.ReadLine();

int b = Int32.Parse(a);

for(int c = 1; c <= b; c++)

{

 

Console.Write("줄넘기를");

Console.ForegroundColor = ConsoleColor.Green;

Console.Write(c);

Console.ForegroundColor = ConsoleColor.White;

Console.WriteLine("회 했습니다.");

 

 

 

 

}

}

else

{

Console.WriteLine("줄넘기를 하지 못했습니다.");

}

 

 

}

}

}

 

Colored by Color Scripter

cs

'Console > Problems' 카테고리의 다른 글

9.20  (0) 2019.09.20

9.20

Console/실습 2019. 9. 20. 13:34

'Console > 실습' 카테고리의 다른 글

상품 목록(3)  (0) 2019.09.23
상품 목록(2)  (0) 2019.09.23
상품 목록(1)  (0) 2019.09.23
9.19  (0) 2019.09.19
9.19  (0) 2019.09.19

9.20

Console/Problems 2019. 9. 20. 13:03

 

해결

 

'Console > Problems' 카테고리의 다른 글

9.20  (0) 2019.09.20

Console.ReadLine();

Console/API 2019. 9. 20. 09:50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax03
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("2019-09-20");
            Console.WriteLine("\nToday is {0:d} at {0:T}.");
            Console.Write("\nPress any key to continue... ");
            Console.ReadLine();
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 
Console.ReadLine 입력받은 문자열값을 출력하고 다음줄로 이동

https://docs.microsoft.com/ko-kr/dotnet/api/system.console.readline?view=netframework-4.8

'Console > API' 카테고리의 다른 글

Console.WriteLine();  (0) 2019.09.20