diff --git "a/\347\214\234\346\225\260\345\255\227" "b/\347\214\234\346\225\260\345\255\227" new file mode 100644 index 0000000000000000000000000000000000000000..58628be0bd29ad0d2b23aa6f0dce6cf4ffd64719 --- /dev/null +++ "b/\347\214\234\346\225\260\345\255\227" @@ -0,0 +1,26 @@ +public static void main(String[] args) throws IOException { + Random a = new Random(); + int num = a.nextInt(100); + System.out.println("请输入一个100以内的整数:"); + for (int i = 0; i <= 9; i++) { + BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); + String str = bf.readLine(); + int shu = Integer.parseInt(str); + if (shu > num) + System.out.println("输入的数大了,输小点的dao!"); + else if (shu < num) + System.out.println("输入的数小了,输大点的!"); + else { + System.out.println("恭喜你,猜对了!"); + if (i <= 2) + System.out.println("你真是个天才!"); + else if (i <= 6) + System.out.println("还将就,你过关了!"); + else if (i <= 8) + System.out.println("但是你还……真笨!"); + else + System.out.println("你和猪没有两样了!"); + break; + } + } + } \ No newline at end of file