呵呵呵
忘了这一茬了,小弟怕献丑啊
import java.io.*;
public class LetterGame()
{
public static void play(String args[])
{ int r;
char s;
System.out.println("请输入一个字符:");
try{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in.read()));
s=br.readLine();
}
catch(IOException e)
{System.out.println("产生异常");}
char c=(char)(Math.random()*26+'a');
r=s.compareTo(c);
if(r>0)
System.out.println("输入的字符太大,应输入更小的字符");
else(r<0)
System.out.println("输入的字符太小,应输入更大的字符");
else(r=0)
System.out.println("输入的字符正确");
}
}