ํฐ์คํ ๋ฆฌ ๋ทฐ
package study;
import javax.swing.*;
public class SwingTest {
public static void main(String[] ar) {
int answer = (int) (Math.random() * 10 ) + 1;
int input =0 ;
String temp = "";
int count = 0 ;
int limitCnt = 5;
do {
count++;
temp = JOptionPane.showInputDialog("1~10๊น์ง์ ์ซ์๋ฅผ ์
๋ ฅํ์์ค ๊ธฐํ๋ 5" + " ๋๋ด๋ ค๋ฉด -1์ ์
๋ ฅํ์ธ์.");
if(temp == null || temp.equals("-1")) break;
System.out.println("์
๋ ฅ๊ฐ : " + temp);
input = Integer.parseInt(temp);
if (answer != input) {
System.out.println("ํ๋ ธ์ต๋๋ค. ๋จ์๊ธฐํ๋ " + (limitCnt - count) + "์
๋๋ค.");
System.out.println("์ ๋ต์ ? " + answer);
} else {
System.out.println("๋ง์ท์ต๋๋ค. ์ถํํด์");
}
} while (count != limitCnt);
}
}
'PROGRAMMING' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
sqlinform.com/online.phtml (0) | 2010.06.16 |
---|---|
์๋ธ๋ฆฟ ํ ํ๋ฆฟ. (0) | 2010.06.08 |
๋ก๋์์ฑ๊ธฐ ใ ใ (0) | 2010.05.15 |
Model1 ๋ฐฉ์ (0) | 2010.05.14 |
ํ๋ก๊ทธ๋๋จธ์ ์๊ธฐ์ฌ์ฐ๊ธฐ... (0) | 2009.10.15 |
- Total
- Today
- Yesterday
- ๋ฉ๋ฐฐํ
- 8๋ง์ผ
- Servlet
- JavaScript
- ์น์์ด์ ์
- ๊ฒฝ์ ์ฉ์ด
- ๊ธฐํ
- ์๋ฐ์คํฌ๋ฆฝํธ
- JSON
- MS-SQL
- ์๋ธ๋ฆฟ
- Ajax
- ์์์ฌ์ด๋
- ์นด๋ฐ์จ๋ผ์ธ
- jQuery
- php
- EL
- JS
- ํจ์
- ๋์ค
- ๋ณต๊ทผ์ด๋
- asp
- JSTL
- MySQL
- JSP
- 2ne1
- ์๋ฆฌ
- I Don't Care
- Java
- ์ธํจ์ด
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |