코드업기초100제8 코드업 기초100제, #1092 ~ #1099 🌼1092 📝 최소공배수 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.ou.. 2022. 9. 17. 코드업 기초100제, #1083 ~ #1091 🌼1083 📝 3 6 9 Game 중첩의 원리 for 문과 if 문 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 = n) break; } bw.write(String.valueOf(s)); //bw.write(String.format("%d", s)); bw.flush(); } } 🌼1088 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; impor.. 2022. 9. 15. 코드업 기초100제, #1073 ~ #1082 🌼1073 📝 0 이 나올때까지 출력하라. while문 사용 //import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String[] splitStr = str.split(" "); //System.out.println(Arrays.toString(splitStr)); int i = 0; while(Integer.parseInt(splitStr[i]) != 0) { System.out.println(splitStr[i]); i++; } } } 🌼.. 2022. 9. 13. 코드업 기초100제, #1063 ~ #1072 🌼1063 📝 삼항 연산자 조건식 ? 피연산자1 : 피연산자2 조건식의 연산결과가 true 이면, 결과는 피연산자 1이고, 조건식의 연산결과가 false 이면 결과는 피연산자2 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.println( a > b? a : b); } } 🌼1064 📝 세 정수 중에 가장 작은 수 출력 import java.util.Scanner; public class Main { public static void .. 2022. 9. 12. 이전 1 2 다음