[JAVA]JAVAの宿題・課題は俺に任せろ v1.004[JAVA]

このエントリーをはてなブックマークに追加
670660
ごめんな〜遅くて、
入力文字をワザワザ数値に変換してると
考えること多くなるので、そのまま比べるやつに変えてたのさ
ホントは数値に変えたほうがいいのだが・・・
import java.io.*;
public class Kazuategame {
public static void main(String[] args) {
final String right = "正解";
final String non = "不正解";
String time="回目";

String answer = String.valueOf((int) (Math.random() * 11));
int count = 1;
try {
BufferedReader bis = new BufferedReader(new InputStreamReader(System.in));
String input;

while ((input = bis.readLine()) != null) {
if (input.equals(answer)) {
System.out.println(right + count + time);
break;
}
else {
System.out.println(non);
count++;
}
}
}
catch (IOException e) {}
finally {}
}
}