목록개발/Java (26)
그저 내가 되었고

답안 소스코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); String[] kda = line.split("/"); int K = Integer.parseInt(kda[0]); int D = Integer.parseInt(kda[1]); int A = Integer.parseInt(kda[2]); if (K + A
목차 1. 배열 오름차순 정렬하기 2. 배열 내림차순 정렬하기 3. 배열의 최대값 구하기 4. 배열의 최소값 구하기 5. 원하는 포맷으로 날짜 표현하기 6. 원하는 포맷으로 시간 표현하기 7. 원하는 형식으로 시간과 날짜 동시에 표현하기 1. 배열 오름차순 정렬하기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Arrays; public class Sort { public static void main(String[] args) { int[] array = {58, 32, 64, 12, 15, 99}; Arrays.sort(array); for(int i = 0; i
예컨대 첫줄에 인티져, 둘쨋줄에 스트링의 입력이 있다고 하자. 이때, 자바의 nextInt()는 해당 줄의 인티져만 인식하고 마지막의 개행문자는 안받는다. nextInt() 후 nextLine()을 쓰면 걔가 같이 개행문자를 받아버린다. 어떤 식이냐면 1 2 3 4 5 6 7 8 9 10 11 12 13 14 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int 숫자 = sc.nextInt(); String 글자 = sc.nextLine(); String 문자 = sc.nextLine(); System.out.println("숫자 :" + 숫자); System.out.print..
Count Me In 성공다국어 시간 제한메모리 제한제출정답맞힌 사람정답 비율 1 초 256 MB 1405 949 875 69.944% 문제 Given a sentence in English, output the counts of consonants and vowels. Vowels are letters in [’A’,’E’,’I’,’O’,’U’,’a’,’e’,’i’,’o’,’u’]. 입력 The test file starts with an integer S(1 ≤ S ≤ 100), the number of sentences. Then follow S lines, each containing a sentence - words of length 1 to 20 separated by spaces. Every..
문제 두 양의 정수가 주어졌을 때, 두 수 사이에 있는 정수를 모두 출력하는 프로그램을 작성하시오. 입력 두 정수 A와 B가 주어진다. 출력 첫째 줄에 두 수 사이에 있는 수의 개수를 출력한다. 둘째 줄에는 두 수 사이에 있는 수를 오름차순으로 출력한다. 서브태스크 번호 배점 제한 1 30 1 ≤ A, B ≤ 1000. 2 70 1 ≤ A, B ≤ 10*15, A와 B의 차이는 최대 100,000. 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nex..