soominkim Study
article thumbnail
[Programmers] 문자열안에 문자열

class Solution { public int solution(String str1, String str2) { int answer = str1.indexOf(str2); if(answer != -1 ) answer = 1; else answer = 2; return answer; } }

article thumbnail
[BAEKJOON] 2562번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] array = new int[9]; for(int i=0; i

article thumbnail
[Programmers] Lv0. 팩토리얼

class Solution { public int solution(int n) { int answer = 1; int sum = 1; while (true) { sum *= answer; if (n < sum) { answer = answer-1; break; } else { if (sum == n) { break; } else { answer++; } } } return answer; } }

article thumbnail
[Programmers] 순서쌍의 개수

class Solution { public int solution(int n) { int answer = 0; for(int i=1; i

article thumbnail
[Programmers] Lv0. 문자열 정렬하기(2)

import java.util.Arrays; class Solution { public String solution(String my_string) { String answer = ""; String[] array = my_string.split(""); Arrays.sort(array,String.CASE_INSENSITIVE_ORDER); for(String data : array){ answer += data.toLowerCase(); } return answer; } }

article thumbnail
[BAEKJOON] 10818번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] array = new int[N]; for(int i = 0; i

article thumbnail
[BAEKJOON] 10871번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int X = sc.nextInt(); int[] array = new int[N]; for(int i=0; i

article thumbnail
[BAEKJOON] 2438번

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i =1; i

article thumbnail
[BAEKJOON] 11022번

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 = 1; i

article thumbnail
[BAEKJOON] 25314번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int longN = N/4; for(int i=1; i

article thumbnail
[BAEKJOON] 25304번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int bil = sc.nextInt(); int many = sc.nextInt(); for(int i=0; i

article thumbnail
[BAEKJOON] 2480번

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = sc.nextInt(); if(num1 != num2 && num2 != num3 && num1 != num3){ int max; if(num1 > num2){ if(num1 > num3){ max = num1; }else{ max = num3; } }else{ if(num2 > num3){ max = num2; }else { max = num3; } } System.out.prin..

검색 태그