목록전체 글 (86)
elesis's haunt
* BufferedReader, BufferedWriter, StringTokenizer package baek; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Exception { // Scanner와 System.out.println 대신 BufferedReader와 BufferedWriter를 사용 BufferedReader br = ne..
class Solution { public String solution(String new_id) { String word = new_id; String result = ""; //1 word = word.toLowerCase(); //2 word = word.replaceAll("\\~|\\!|\\@|\\#|\\$|\\%|\\^|\\&|\\*|\\(|\\)|\\=|\\+|\\[|\\{|\\]|\\}|\\:|\\?|\\,|\\|\\/", ""); //3 word = word.replaceAll("\\.+", "."); //4 word = word.replaceAll("^\\.", ""); word = word.replaceAll("\\.$", ""); //5 if(word.length()==0) word..
class Solution { public int[] solution(int[] lottos, int[] win_nums) { int cnt = 0; int random = 0; int min = 0; int max = 0; for(int i=0;i w == l) || l == 0).count(), (lottos.length + 1) - Arrays.stream(lottos).filter(l -> Arrays.stream(winNums).anyMatch(w -> w == l)).count() ) .mapToInt(op -> (int) (op > 6 ? op - 1 : op)) .toArray(); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); int num = 0; int sum = 0; for(int i=0; i 0) sum += n--; System.out.println(sum); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for(int i=0; i
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); for(int i=1; i
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int m = sc.nextInt(); sc.close(); if( m >= 45 ) { m -= 45; } else { if( h == 0 ) { h = 23; m = 60-45+m; } else { h -= 1; m = 60-45+m; } } System.out.print(h+" "+m); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); sc.close(); if( x>0 && y>0 ) { System.out.print(1); } else if( x0 ) { System.out.print(2); } else if( x