ComputerScience

    C# 백준 1271번: 엄청난 부자2

    using System; using System.Numerics; class Program { static void Main(string[] args) { string stringInput = Console.ReadLine(); string[] arrayStrings = stringInput.Split(' ', StringSplitOptions.None); BigInteger N = BigInteger.Parse(arrayStrings[0]); BigInteger M = BigInteger.Parse(arrayStrings[1]); BigInteger divided = N / M; BigInteger remained = N % M; Console.WriteLine(divided); Console.Writ..

    C# 백준 10757번: 큰 수 A + B

    using System; using System.Numerics; class Program { static void Main(string[] args) { string stringInput = Console.ReadLine(); string[] arrayStrings = stringInput.Split(' ', StringSplitOptions.None); BigInteger A = BigInteger.Parse(arrayStrings[0]); BigInteger B = BigInteger.Parse(arrayStrings[1]); Console.WriteLine(A + B); } } 문제 출처 https://www.acmicpc.net/problem/10757 10757번: 큰 수 A+B 두 정수 A와..

    백준 2420번: 사파리월드

    using System; class Program { static void Main(string[] args) { string stringInput = Console.ReadLine(); string[] array = stringInput.Split(' ', StringSplitOptions.None); long a = System.Convert.ToInt64(array[0]); long b = System.Convert.ToInt64(array[1]); long result = 0; if (a < b) { result = b - a; } else { result = a - b; } result = Math.Abs(result); Console.WriteLine(result); } } 문제 출처 http..

    백준 11382번: 꼬마 정민

    using System; class Program { static void Main(string[] args) { string stringInput = Console.ReadLine(); string[] arrayInput = stringInput.Split(' ', StringSplitOptions.None); long[] intResult = new long[3] {0, 0, 0}; for (int i = 0; i < 3; i++) { intResult[i] = System.Convert.ToInt64(arrayInput[i]); } long total = 0; for (int i = 0; i < 3; i++) { total += intResult[i]; } Console.WriteLine(total..

    백준 9086번: 문자열

    using System; class Program { static void Main(string[] args) { string stringNumber = Console.ReadLine(); int intNumber = System.Convert.ToInt32(stringNumber); string[] result = new string[intNumber]; for (int i = 0; i < intNumber; i++) { string testCase = Console.ReadLine(); char[] array = testCase.ToCharArray(); result[i] = array[0].ToString() + array[array.Length - 1].ToString(); } foreach (s..

    백준 11718번: 그대로 출력하기

    using System; class Program { static void Main(string[] args) { while (true) { string input = Console.ReadLine(); if (string.IsNullOrEmpty(input) == true) break; Console.WriteLine(input); } } } 문제 출처 https://www.acmicpc.net/problem/11718 11718번: 그대로 출력하기 입력이 주어진다. 입력은 최대 100줄로 이루어져 있고, 알파벳 소문자, 대문자, 공백, 숫자로만 이루어져 있다. 각 줄은 100글자를 넘지 않으며, 빈 줄은 주어지지 않는다. 또, 각 줄은 공백으로 시 www.acmicpc.net

    백준 2754번: 학점계산

    using System; class Program { static void Main(string[] args) { string stringScore = Console.ReadLine(); float score = 0; switch (stringScore) { case "A+": score = 4.3f; break; case "A0": score = 4.0f; break; case "A-": score = 3.7f; break; case "B+": score = 3.3f; break; case "B0": score = 3.0f; break; case "B-": score = 2.7f; break; case "C+": score = 2.3f; break; case "C0": score = 2.0f; brea..

    백준 2744번: 대소문자 바꾸기

    using System; class Program { static void Main(string[] args) { string word = Console.ReadLine(); char[] wordArray = word.ToCharArray(); string result = ""; foreach (char c in wordArray) { if (Char.IsLower(c) == true) { string s = c.ToString().ToUpper(); result += s; } else if (Char.IsUpper(c) == true) { string s = c.ToString().ToLower(); result += s; } } Console.WriteLine(result); } } 문제 출처 htt..

    백준 2743번: 단어 길이 재기

    using System; class Program { static void Main(string[] args) { string word = Console.ReadLine(); Console.WriteLine(word.Length); } } 문제 출처 https://www.acmicpc.net/problem/2743 2743번: 단어 길이 재기 알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오. www.acmicpc.net

    백준 11654번: 아스키 코드

    using System; class Program { static void Main(string[] args) { string ascii = Console.ReadLine(); char[] c = ascii.ToCharArray(); int code = (int)c[0]; Console.WriteLine(code); } } 문제 출처 https://www.acmicpc.net/problem/11654 11654번: 아스키 코드 알파벳 소문자, 대문자, 숫자 0-9중 하나가 주어졌을 때, 주어진 글자의 아스키 코드값을 출력하는 프로그램을 작성하시오. www.acmicpc.net

    백준 7287번: 등록

    using System; class Program { static void Main(string[] args) { Console.WriteLine("49"); Console.WriteLine("ddayin"); } } 문제 출처 https://www.acmicpc.net/problem/7287 7287번: 등록 첫 줄에 자신이 맞은 문제의 수, 둘째 줄에 아이디를 출력한다. www.acmicpc.net

    백준 10699번: 오늘 날짜

    실버 문제 풀다가 막혀서 쉬운 걸로 하나 풀기. using System; class Program { static void Main(string[] args) { Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd")); } } 문제 출처 https://www.acmicpc.net/problem/10699 10699번: 오늘 날짜 서울의 오늘 날짜를 출력하는 프로그램을 작성하시오. www.acmicpc.net

    백준 4344번: 평균은 넘겠지

    백준 4344번: 평균은 넘겠지

    한참 헤메었다. Visual Studio에서 디버깅 하면서 진행하였다. 소수점 3자리까지 반올림해서 표시하는 부분에서 많이 막혔다. using System; class Program { public class TestCaseData { public int total = 0; public int[] scoresArray = null; public double average = 0f; public double overAverageRate = 0f; } static void Main(string[] args) { string stringTestCase = Console.ReadLine(); int intTestCase = System.Convert.ToInt32(stringTestCase); TestCaseD..

    백준 8958번: OX퀴즈

    using System; class Program { static void Main(string[] args) { string stringNumber = Console.ReadLine(); int intNumber = System.Convert.ToInt32(stringNumber); int[] resultArray = new int[intNumber]; for (int i = 0; i < intNumber; i++) { string stringOX = Console.ReadLine(); char[] array = stringOX.ToCharArray(); int score = 0; int total = 0; for (int j = 0; j < array.Length; j++) { if (array[j]..

    백준 1546번: 평균

    using System; class Program { static void Main(string[] args) { string stringNumber = Console.ReadLine(); int intNumber = System.Convert.ToInt32(stringNumber); int[] intScoresArray = new int[intNumber]; string stringScores = Console.ReadLine(); string[] array = stringScores.Split(' ', StringSplitOptions.None); for (int i = 0; i < array.Length; i++) { intScoresArray[i] = Convert.ToInt32(array[i])..

    난수에 대해서 깊게 공부할 필요

    검색 키워드 : uniform distribution random