코딩테스트 문제 풀이/[백준] 기본 수학2(11)
-
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# 백준 3053번 택시 기하학, 소수점 이하 6자리
코드 : using System; namespace _10 { class Program { static void Main(string[] args) { int r = Convert.ToInt32(Console.ReadLine()); double uS = Math.PI * r * r; double tS = 2 * r * r; /* 21 >> 1,385.442360 콤마가 찍힘 Console.WriteLine("{0:N6}",uS); Console.WriteLine("{0:N6}", tS); */ Console.WriteLine("{0:.000000}", uS); Console.WriteLine("{0:.000000}", tS); } } } 이 문제는 택시 기하학이 먼지를 모르면 풀 수 가 없다. 나도 몰라..
2022.01.03 -
C# 백준 4153번 직각삼각형
using System; namespace _9 { class Program { static void Main(string[] args) { while(true) { string input = Console.ReadLine(); string[] inputdata = input.Split(' '); int x, y, z; x = Convert.ToInt32(inputdata[0].ToString()); y = Convert.ToInt32(inputdata[1].ToString()); z = Convert.ToInt32(inputdata[2].ToString()); if(x == 0 && y == 0 && z == 0) break; if (x * x + z * z == y * y) Console.WriteL..
2022.01.03 -
C# 백준 3009번 네 번째 점
코드 : using System; namespace _8 { class Program { static void Main(string[] args) { string input1 = Console.ReadLine(); string[] input1data = input1.Split(' '); string input2 = Console.ReadLine(); string[] input2data = input2.Split(' '); string input3 = Console.ReadLine(); string[] input3data = input3.Split(' '); int x1, x2, x3; int y1, y2, y3; x1 = Convert.ToInt32(input1data[0].ToString()); x2 ..
2022.01.03 -
C# 백준 1085번 직사각형에서 탈출
코드 : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _7 { internal class Program { static void Main(string[] args) { string input = Console.ReadLine(); string[] inputdata = input.Split(' '); //2 1 4 4 int x = Convert.ToInt32(inputdata[0]); int y = Convert.ToInt32(inputdata[1]); int w = Convert.ToInt32(inputdata[2]); in..
2022.01.03 -
C# 백준 9020번 골드바흐의 추측
using System; using System.Text; using System.Collections.Generic; namespace _6 { internal class Program { static void Main(string[] args) { int T = Convert.ToInt32(Console.ReadLine()); for (int K = 0; K < T; K++) { int input = Convert.ToInt32(Console.ReadLine()); int first = 0; int second = 0; int firstSave = 0; int secondSave = 0; int difference = 10000; List deArray = decimalArray(input); for..
2022.01.03