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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace unityStudy
{
    class App
    {
 
        float c;
 
        public App() // 생성자
        {
            Console.WriteLine("Helloworld");
 
            // 데이터 형식
 
            // 숫자 (값형식)
            // 정수
            // 부동 소수점
 
            // 문자 
 
            int a = 5;
            Console.WriteLine(a);
 
 
            string name = "조효준";
            Console.WriteLine(name);
 
            float b = 5.4f;
            Console.WriteLine(b);
                
            Console.WriteLine(c);
 
            Console.WriteLine(name + " " + a + " " + b);
 
            string heroName = "\"" + "아이언맨" + "\"";
            Double heroMaxHp = 10;
 
            string monsterName = "\"" + "타노스" + "\"";
            Double monsterDamage = 3;
            Double heroHp = heroMaxHp - monsterDamage;
 
           
 
            Console.WriteLine("ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ");
 
            //타노스가 아이언맨을 공격 했습니다.
            Console.WriteLine(monsterName +  "가 " + heroName+ "을 " + monsterDamage + " 만큼 공격 했습니다" );
            Console.WriteLine(heroName + "의 체력은 (" + heroHp + "/" + heroMaxHp + ") 입니다.");
            
            Console.WriteLine(heroName + "의 체력은 (" + heroHp + "/" + heroMaxHp + ")," + (heroHp / heroMaxHp)*100  + "% 입니다.");
 
 
 
 
 
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

 

 

쌍따옴표 출력 방법

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

20200408 - 반복문  (0) 2020.04.08
20200407 - while 과제  (0) 2020.04.07
20200407 - 장검 과제  (0) 2020.04.07
20200406 - for문 별찍기  (0) 2020.04.06
20200403 - for문 과제 1  (0) 2020.04.03

+ Recent posts