일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- java
- DART
- 연습문제
- 비즈니스일본어
- html
- 日本語
- Python
- C로 시작하는 컴퓨터 프로그래밍4판
- springboot
- 건담
- 인프런
- javascript
- 디지몬
- 일본어
- 건담베이스
- jsp
- ruby
- メソッド
- nico
- vscode
- CSS
- 반다이몰
- Flutter
- rails7
- 単語
- 자바
- Spring
- 一日一つメソッド
- rails
- Web
Archives
- Today
- Total
목록로또자동생성 (1)
AR삽질러
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bYAw90/btr0oAtgjCe/psS2KdHI16gs849xM9ruA1/img.png)
Java 로또번호 자동생성기 만들기 1. 1부터 45까지의 숫자 중에서 중복되는 번호 없이 6개의 숫자를 랜덤하게 생성한다. 번호를 두번돌려 중복이 없는 숫자를 찾는다. public class Lotto { public static void main(String[] args) { // 로또번호자동 생성기 // 1부터 45까지의 숫자 중에서 중복 없이 6개의 숫자를 랜덤하게 생성 Random random = new Random(); // 랜덤객체 int[] lottoNumber = new int[6]; for(int i = 0; i < 6; i++) { int number = random.nextInt(45)*1; for(int j = 0; j < i; j++) { if(lottoNumber[j] == n..
JAVA
2023. 2. 22. 16:28