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