일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 인터페이스
- analytics4
- MongoDB
- git
- oracle
- JPA
- 트랜잭션
- 티스토리챌린지
- SQL
- PostgreSQL
- 추상클래스
- MariaDB
- 차이점
- spring
- Javascript
- IntelliJ
- rsync
- mysql
- docker
- DBMS
- 오블완
- group by
- 명령어
- mssql
- java
- top
- 호이스팅
- 리눅스
- Linux
- 자바
- Today
- Total
목록Study/ALGORITHM (42)
hanker
import java.util.Scanner; public class Main { /** * 알파벳 찾기 * a ~ z 까지의 알파벳이 있으면 단어의 자릿수를 출력하고 없으면 -1 출력 * - input : baekjoon * - output : 1 0 -1 -1 2 -1 -1 -1 -1 4 3 -1 -1 7 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); // 문자열 S의 길이 int wordLen = S.length(); // 각 자릿수를 charArray 형태로 변환 char[] ar = S.toChar..
import java.util.Scanner; public class Main { /** * N개의 숫자가 공백 없이 쓰여있다. 이 숫자를 모두 합해서 출력하는 프로그램을 작성하시오. */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); char[] ar = new char[N]; int sum = 0; String number = sc.next(); ar = number.toCharArray(); for(int i = 0 ; i < N ; i++) { sum += Character.getNumericValue(ar[i]); } System.out.println(sum); } }
import java.util.Scanner; public class Main { /* * ASCII 코드 * */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); char word = sc.next().charAt(0); System.out.println((int)word); } }
import java.util.Scanner; public class Main { /* * 한수 * 양의 정수 각 자릿수가 등차수열을 이루면 그 수를 한수라고 한다. * ex) 1 ~ 9 한수 * 10 ~ 99 한수 * - 10 : 1 -> 0 공차 : -1 * - 25 : 2 -> 5 공차 : +3 */ public static void main(String[] args) { //1 < N < 1000 Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int sum = subClass2.cdCnt(N); System.out.println(sum); } } class subClass2 { static int cdCnt(int N) { int[] ar..
public class Main { public static void main(String[] args) { int N = 10000; int[] ar = new int[N]; int max = subClass.maxValue(Integer.toString(N)); int[] selfNum = new int[max+1]; for(int i = 1 ; i
class Test{ public static long sum(int[] a){ long sum = 0; for(int i = 0 ; i < a.length; i++) { sum += a[i]; } return sum; } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int C = 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(); String[] ar = new String[N]; for(int i = 0 ; i < N ; i++) { int sum = 0; int tmp = 0; ar[i] = sc.next(); for(int j = 0 ; j < ar[i].toCharArray().length ; j++) { char[] ox = new char[ar[i].toCharArray().length]; ox[j] = ar[i].toCharArray()[j]; if(ox[j] ..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] ar = new int[N]; int maxScore = 0; float sum = 0; float avr = 0; for(int i = 0 ; i < N ; i++) { ar[i] = sc.nextInt(); if(maxScore < ar[i]) { maxScore = ar[i]; } } for(int i = 0 ; i < N ; i++) { float tmp = (float) (ar[i] * 100) / maxScore ; sum +..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] ar = new int[10]; int tmp = 0; int cnt = 0; boolean flag2 = false; for(int i = 0 ; i < 10 ; i++) { boolean flag = true; int A = sc.nextInt(); tmp = A % 42; if(tmp == 0) { flag2 = true; } for(int j = 0 ; j < 10 ; j++) { if(ar[j] == tmp) { flag = false; } } if(flag) { a..