
1859 - 백만 장자 프로젝트
2022. 11. 11. 01:08
알고리즘(종합)/Lv.2
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

2072 - 홀수만 더하기
2022. 11. 10. 17:37
알고리즘(종합)/Lv.1
10개의 숫자중 홀수만 더하라. 입력 3 3 17 1 39 8 41 2 32 99 2 22 8 5 123 7 2 63 7 3 46 6 63 2 3 58 76 21 33 8 1 출력 #1 200 #2 208 #3 121 class Solution { public static void main(String args[]) throws Exception { //System.setIn(new FileInputStream("res/input.txt")); Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); int count=0; for(int test_case = 1; test_case

2056 - 연월일 달력
2022. 11. 10. 16:30
알고리즘(종합)/Lv.1
문제: 22220101 -> 2222/01/01 로 바꿔준다. 조건1 : 년월에 어긋나는 날은 -1 로 출력한다. 조건2 : 윤년은 제외하고 평년으로만 한다. package test; import java.io.IOException; import java.util.Scanner; public class Main { static int [] day = {31,28,31,30,31, 30,31,31,30,31, 30,31}; public static void main(String[] args) throws IOException { int [] day = {31,28,31,30,31, 30,31,31,30,31, 30,31}; String yyyy; int mm; String s_mm; int dd; Stri..

Do it - 기본 자료구조
2022. 11. 10. 12:28
알고리즘(종합)/Lv.1
윤년 / 평년 날짜 구하기 (배열, for문) 윤년은 4로 나눠 떨어지면서 100으로는 나눠떨이지면 안되지만 400으로 떨어지면 윤년이다. package test; import java.io.IOException; import java.util.Scanner; public class Main { static int [][] day = { {31,28,31,30,31, 30,31,31,30,31, 30,31}, {31,29,31,30,31, 30,31,31,30,31, 30,31}, }; static int isyear(int year) { if(year%4==0&&year%100!=0||year%400==0) { return 1; } return 0; } static int sumday(int year,..