본문 바로가기
반응형

코딩테스트 준비/백준 C#161

백준 C# 10869 using System; namespace baek2 { class Program { static void Main(string[] args) { string input; string[] token; input = Console.ReadLine(); token = input.Split(' '); int A = int.Parse(token[0]); int B = int.Parse(token[1]); Console.WriteLine($"{(A+B)}"); Console.WriteLine($"{(A-B)}"); Console.WriteLine($"{(A*B)}"); Console.WriteLine($"{(A/B)}"); Console.WriteLine($"{(A%B)}"); } } } 2023. 4. 6.
백준 C# 1008 using System; namespace baek2 { class Program { static void Main(string[] args) { string input; string[] token; input = Console.ReadLine(); token = input.Split(' '); double A = double.Parse(token[0]); double B = double.Parse(token[1]); Console.WriteLine($"{(A/B)}"); } } } 2023. 4. 6.
백준 C# 10998 using System; namespace baek2 { class Program { static void Main(string[] args) { string input; string[] token; input = Console.ReadLine(); token = input.Split(' '); int A = int.Parse(token[0]); int B = int.Parse(token[1]); Console.WriteLine("{0}", A*B); } } } 2023. 4. 6.
백준 C# 1001 using System; namespace baek2 { class Program { static void Main(string[] args) { string input; string[] token; input = Console.ReadLine(); token = input.Split(' '); int A = int.Parse(token[0]); int B = int.Parse(token[1]); Console.WriteLine("{0}", A-B); } } } 2023. 4. 6.
백준 C# 1000 using System; namespace baek2 { class Program { static void Main(string[] args) { string input; string[] token; input = Console.ReadLine(); token = input.Split(' '); int A = int.Parse(token[0]); int B = int.Parse(token[1]); Console.WriteLine("{0}", A+B); } } } 다른 방법 string input = Console.ReadLine(); string[] arr = input.Split(): Console.WriteLine(int.Parse(arr[0])-int.Parse(arr[1])); 2023. 4. 6.
반응형