https://www.youtube.com/watch?v=QSf4HUR0nPI&list=PLO56HZSjrPTB4NxAsEP8HRk6YKBDLbp7m&index=16
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
Write("성함을 입력해주세요 : ______\b\b\b\b\b\b");
string str = ReadLine();
WriteLine(str);
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
int asc = Read();
WriteLine(asc);
WriteLine(Convert.ToChar(asc));
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
long l = long.MaxValue;
int i = (int)l;
WriteLine(i);
i = int.MaxValue;
l = (long)i;
WriteLine(l);
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
string strNum = ReadLine();
int number = Int32.Parse(strNum);
WriteLine(strNum + number);
WriteLine(number + number);
strNum = ReadLine();
number = Convert.ToInt32(strNum);
WriteLine(strNum + number);
WriteLine(number + number);
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
int number = 10; // -> 1010
WriteLine(Convert.ToString(number, 2));
WriteLine(Convert.ToString(number, 2).PadLeft(8, '0'));
string str = "1010";
WriteLine(Convert.ToInt32(str, 2));
WriteLine(0b0001);
WriteLine(0b1010_0001);
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
var type1 = 'a';
WriteLine(type1.GetType());
var type2 = "abc";
WriteLine(type2.GetType());
var type3 = 123;
WriteLine(type3.GetType());
}
}
}
using System;
using static System.Console;
namespace testProject
{
class Program
{
static void Main(string[] args)
{
int i = default;
WriteLine(i);
double d = default;
WriteLine(d);
char c = default;
WriteLine(c);
string s = default;
WriteLine(s);
}
}
}