본문 바로가기

정올

[Java] 정올기초다지기 배열2-형성평가01 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 package 배열2.형성평가01; import java.util.Scanner; public class Main { public static void main(String[] args) { int dice [] = {1,2,3,4,5,6}; int [] cnt = new int [6]; int num =0; Scanner sc = new Scanner(System.in); for(int i=0;i 더보기
[Java] 정올기초다지기 배열2-자가진단07 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 package 배열2.자가진단07; public class Main { public static void main(String[] args) { int [][] arr = new int [5][5]; for(int i=0;i 0) { arr[i][j] = arr[i-1][j]+arr[i][j-1]; } } } for(int i=0;i0&&j>0) i와j가 둘다 (and) 0보다 클경우(1행과1열이 아닐경우) 바로위 숫자와 바로전 숫자를 더하여준다. 더보기
[Java] 정올기초다지기 배열2-자가진단06 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 29 30 31 32 33 34 35 36 37 38 package 배열2.자가진단06; import java.util.Scanner; public class Main { public static void main(String[] args) { int [][] arr = new int [5][4]; int num =0; int sum =0; int cnt =0; Scanner sc = new Scanner(System.in); for(int i=0;i 더보기
[Java] 정올기초다지기 배열2-자가진단05 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 29 30 31 package 배열2.자가진단05; import java.util.Scanner; public class Main { public static void main(String[] args) { int [][] arr = new int [2][4]; int [][] arr2 = new int [2][4]; int num = 0; Scanner sc = new Scanner(System.in); for(int i=0;i 더보기
[Java] 정올기초다지기 배열2-자가진단04 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package 배열2.자가진단04; public class Main { public static void main(String[] args) { int [][] arr = { {5,8,10,6,4}, {11,20,1,13,2}, {7,9,14,22,3} }; for(int i=0;i 더보기
[Java] 정올기초다지기 배열2-자가진단03 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 29 package 배열2.자가진단03; import java.util.Scanner; public class Main { public static void main(String[] args) { int [] arr = new int [100]; int num = 0; Scanner sc = new Scanner(System.in); num = sc.nextInt(); arr[0] = 100; arr[1] = num; for(int i=2;i 더보기
[JAVA] 정올기초다지기 배열2-자가진단02 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 29 30 import java.util.Scanner; public class Main { public static void main(String[] args) { int [] arr = new int [10]; int num =0; int stop =0; Scanner sc = new Scanner(System.in); while(true) { num = sc.nextInt(); if(num ==0) { for(int i=0;i 0) { System.out.println(i+" : "+arr[i]); } } break; } for(int i=0;i 문제에서 제시한 십의.. 더보기
[JAVA] 정올기초다지기 배열2-자가진단01 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 29 30 31 32 33 34 35 36 37 38 package 배열2.자가진단01; import java.util.Scanner; public class Main { public static void main(String[] args) { String arr [] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; int [] out = new int [arr.length]; String in = ""; int cnt =0; .. 더보기