728x90
반응형

백준알고리즘 16

[C#] 백준 알고리즘 10818번, 최소, 최대

namespace 백준10818번 { class Program { static void Main(string[] args) { // 입력 받음 int n = int.Parse(Console.ReadLine()); // 입력받은 숫자 길이만큼의 배열을 생성 int[] arr = new int [n]; // 두번째로 입력받는 숫자들을 공백기준으로 잘라서 배열로 저장 string[] s = Console.ReadLine().Split(); // int로 바꿔서 저장 for (int i=0; i 하면 배열 정렬됨!!! 출처 게시글 : https://coding-of-today.tistory.com/92 [백준] C# : 최소, 최대 (10818번) 백준 단계별로 풀어보기 5단계 1차원배열 1번문제 10818번:..

C#/C# (백준) 2022.08.11

[C#] 백준 알고리즘 2480, 주사위 세개

if마다 Console.WriteLine을 쓰지않고 money를 만들어주었다. using System; public class bj2480 { public static void Main(string[] args) { String[] dice = Console.ReadLine().Split(); int a = int.Parse(dice[0]); int b = int.Parse(dice[1]); int c = int.Parse(dice[2]); int money=0; if (a==b && a==c && b==c){ money = 10000+a*1000; } else if (a==b){ money = 1000+a*100; } else if (a==c){ money = 1000+a*100; } else if (..

C#/C# (백준) 2022.07.22
728x90
반응형