[SWEA][D2] 1859. 백만 장자 프로젝트 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); for(int test_case = 1; test_case = 0 ; i--) { if(maxPrice 1. 자료형을 생각할것! long을 쓸수도있음2. 거꾸로 계산하는 방법으로 문제를 풀수 있다는 사실을 생각할것
[SWEA][D2] 21425. += Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); for(int test_case = 1; test_case
[SWEA][D1] 2070. 큰 놈, 작은 놈, 같은 놈 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); for(int test_case = 1; test_case B){ result = ">"; } else if (A == B) { result = "="; }else{ result = "..
[SWEA][D1] 2068. 최대수 구하기 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); for(int test_case = 1; test_case result) result = value; } System.out.println("#"+test_case +" "+ result); } } }
[SWEA][D1] 2063. 중간값 찾기 Java
·
알고리즘 문제풀이
import java.util.Arrays; import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int N; N = sc.nextInt(); int[] values = new int[N]; for (int i = 0; i
[SWEA][D1] 2058. 자릿수 더하기 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int N; N = sc.nextInt(); int sum = 0; while (N > 0){ sum = sum + (N % 10); N = N / 10; } System.out.print(sum); } }