문제풀이14 [Java] Random Game Up&Down 숫자 맞추기. (1~100까지, 10회) import java.util.Scanner; public class RandomGame { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //선언부(변수) int randNum, userNum; boolean clear; //초기화 clear = false; //Random randNum = (int)(Math.random()*100)+1; int w = 0; while(w randNum) { msg = 0; }else if(userNu.. 2021. 5. 10. [Java] Lotto, 숫자 중복 없이 5000원어치 public class Lotto { public static void main(String[] args) { boolean swit[] = new boolean[45]; int lotto[] = new int[30]; int w, r; w = 0; while(w < 30) { r = (int)(Math.random()*45); if(swit[r] == false) { swit[r] = true; lotto[w] = r + 1; w++; } } for(int i=0; i 2021. 5. 10. 이전 1 2 3 다음