c#(2)
-
C# 백준1002번 터렛, 원의 내접, 외접
코드 : using System; namespace _11 { class Program { static void Main(string[] args) { int T = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < T; i++) { string input = Console.ReadLine(); string[] inputdata = input.Split(' '); int x1, y1, r1, x2, y2, r2; x1 = Convert.ToInt32(inputdata[0].ToString()); y1 = Convert.ToInt32(inputdata[1].ToString()); r1 = Convert.ToInt32(inputdata[2].ToString..
2022.01.03 -
[C#] 백준 11654번 아스키 코드
using System; namespace _1 { class Program { static void Main(string[] args) { var input = Convert.ToChar(Console.ReadLine()); Console.WriteLine(Convert.ToInt32(input)); } } } C#에서 아스키코드로 변환하는 방법은 Char형을 int형으로 변환해주기만 하면 된다. 주의할 점은 앞으로 string에서 int로 변환할때 Char인지 아닌지를 주의해야한다. 엉뚱하게 아스키코드가 출력될 수 있다.
2021.12.19