https://www.youtube.com/watch?v=zOPzGzQlyuY&list=PLO56HZSjrPTB4NxAsEP8HRk6YKBDLbp7m&index=14
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
char word = 'a';
char kor = '가';
char es = '\n';
WriteLine("{0}, {2}, {1}", word, kor, es);
}
}
}
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
string str = "abcdef";
string name = "문민승";
string es = "\n\n\n\n";
WriteLine($"{str}, {es}, {name}");
}
}
} }
}
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
string str = @"a
b
c
d
e
f";
string str2 = "a" +
"b" +
"c";
WriteLine(str);
WriteLine(str2);
}
}
}
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
bool check = true;
bool success = false;
if(check)
{
WriteLine("성공");
}else
{
WriteLine("실패");
}
if(success)
{
WriteLine("성공");
}
else
{
WriteLine("실패");
}
}
}
}
using System;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
Char c = 'A'; //char
String s = "ABC"; // string
Boolean b = true; // bool
Console.WriteLine($"{c}, {s}, {b}");
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
int number1 = 1234; // int 키워드 : 기본형식
Int32 number2 = 1234; // System.Int32 구조체 : .NET 형식
WriteLine($"{number1}, {number2}");
string str1 = "abc"; // string 키워드 : 기본 형식
String str2 = "abc"; // System.String 구조체 : .NET 형식
WriteLine($"{str1}, {str2}");
}
}
}