import java.util.Scanner;
import java.util.Random;
class ZuoYe
{
public static void main(String[] args)
{
//Scanner scann =new Scanner(System.in);
//int i = scann.nextInt();
getSymboleAndShu();
}
public static void getSymboleAndShu(){
int cj = 0;
for (int i = 1; i <= 10 ; i++) {
char[] arr = {'+' , '-', '*' , '/'};
Random r = new Random();
int i1 = r.nextInt(30);
int i2 = r.nextInt(4);
int i3 = r.nextInt(10);
System.out.print(i1+" "+arr[i2]+" "+i3+" = ");
Scanner scann = new Scanner(System.in) ;
int i4 = scann.nextInt();
if (i1 (i2) i3 == i4) {
cj+=10;
}
}
System.out.println("您的最终成绩是"+cj+"分");
}
}
为什么我这个代码编译会出错呢?求解! |