09.20 과일입력, 숫자입력, 문자열에 따옴표입력

C#/실습 2019. 9. 20. 10:21

예제:

0920예제

코드:

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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace _09._20
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("당신이 좋아하는 과일의 이름은 무엇입니까?  ");
            string fruit = Console.ReadLine();
            Console.WriteLine($"오! 당신은 {fruit}를 좋아하는군요!");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("*** 0보다 크고 100보다 작은 숫자 두개를 입력하고 출력 하기***");
            Console.Write("첫번째 숫자를 입력 해 주세요:  ");
            string strnum1 = Console.ReadLine();
            Console.Write("두번째 숫자를 입력 해 주세요:  ");
            string strnum2 = Console.ReadLine();
            Console.WriteLine($"당신이 입력한 숫자는 {strnum1}, {strnum2}입니다.");
            int num1 = Convert.ToInt32(strnum1);
            int num2 = Convert.ToInt32(strnum2);
            Console.WriteLine($"당신이 입력한 숫자의 합은 {num1 + num2}입니다.");
        }
    }
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
 
: