- Today
- Total
목록Java (46)
Codemental

문제 제출답안 (2022.07.22) import java.io.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); br.close(); if(N == 0 ) { System.out.println(0); }else if( N ==1 ) { System.out.println(1); }else { System.out.println(fibonacci(2, N, 0, 1))..

문제 제출답안 (2022.07.22) import java.io.*; public class Main { static String q = "\"재귀함수가 뭔가요?\"\n"; static String a1 = "\"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.\n"; static String a2 = "마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.\n"; static String a3 = "그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어.\"\n"; static String al = "라고 답변하였지.\n"; static StringBuilder head = new StringBuilder(..

문제 제출답안 (2022.07.22) import java.io.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); System.out.println(factorial(N, 1)); } public static int factorial(int N, int result) { if(N == 0) { return 1; } result *= N; N--; if(N == 0)..

문제 제출답안 (2022.07.22) class Test { long sum(int[] a) { long sum = 0; for(int i = 0 ; i < a.length; i++) { sum += a[i]; } return sum; } } 채점결과 (2022.07.22)

문제 제출답안 (2022.07.22) import java.io.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int cnt = Integer.parseInt(br.readLine()); int sum = 0; for(int i = 1 ; i

문제 제출답안 (2022.07.22) import java.io.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); br.close(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); for(int i =num ; i > 0; i--) { bw.write(i + "\n"); ..

문제 제출답안 1(2022.07.22) import java.io.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); br.close(); for(int i = 1 ; i

문제 제출답안 (2022.07.21) import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); System.out.println(cntWord(str)); } public static int cntWord(String str) { int cnt = 0; for(int i = 0 ; i < 100; i++) { if(str.indexOf("c=") == 0 || str.indexOf("c-") == 0 || s..