第1个回答 2011-09-28
public class panduan{
public static void main(String [] args){
int x=(int)(10+Math.random()*90);
int y=(int)(10+Math.random()*90);
int z;
System.out.print(x+"+"+y+"=");
Scanner scanner=new Scanner(System.in);
z=scanner.nextInt();
if(z==y+z){
System.out.println(x+"+"+y+"="+z+" √ ");
}else{
System.out.println(x+"+"+y+"="+z+" × ");
}
}
}
大体上应该是这样的。好些年没写JAVA了。也没测试环境。您看一下是否有帮助
第2个回答 2011-09-27
program ss(input,output);
var
a,b,c,i,s:integer;
begin
randomize;
s:=0;
for i:=1 to 10 do
BEGIN
a:=random(100);
b:=random(100);
writeln(a,'+',b,'=');
read(c);
if c=a+b then s:=s+10;
END;
writeln('your score:',c);
END.