一百以内四则运算
import java.util.Random;
import java.util.Scanner;
public class Test
{
public static void main(String [] args)
{
System.out.println("注:本次测试一共十道题,每题十分,满分100"); System.out.println("做题前请认真读题,祝您考试愉快!"); Random r=new Random();
int sum=0;
for(int i=0;i<10;i++)
{
int m,n;
m=r.nextInt()%10;
n=m%2;
switch(n)
{
case -1:
int a,b,c;
a=r.nextInt()%10;
b=r.nextInt()%10;
System.out.println(a+"+"+"("+b+")=?");
Scanner x=new Scanner(System.in);
c=x.nextInt();
if(c!=a+b)
System.out.println("回答错误!!!");
else
{System.out.println("回答正确!!");
sum=sum+10;}
break;
case 0:
int q,w,eimport java.util.Random;
import java.util.Scanner;
public class Test
{
public static void main(String [] args)
{
System.out.println("注:本次测试一共十道题,每题十分,满分100"); System.out.println("做题前请认真读题,祝您考试愉快!"); Random r=new Random();
int sum=0;
for(int i=0;i<10;i++)
{
int m,n;
m=r.nextInt()%10;
n=m%2;
switch(n)
{
case -1:
int a,b,c;
a=r.nextInt()%10;
b=r.nextInt()%10;
System.out.println(a+"+"+"("+b+")=?");
Scanner x=new Scanner(System.in);
c=x.nextInt();
if(c!=a+b)
System.out.println("回答错误!!!");
else
{System.out.println("回答正确!!");
sum=sum+10;}
break;
case 0:
int q,w,e;
q=r.nextInt()%10;
w=r.nextInt()%10;
System.out.println(q+"*"+"("+w+")"+"=?");
Scanner y=new Scanner(System.in);
e=y.nextInt();
if(e!=q*w)
System.out.println("回答错误!!!");
else;
q=r.nextInt()%10;
w=r.nextInt()%10;
System.out.println(q+"*"+"("+w+")"+"=?");
Scanner y=new Scanner(System.in);
e=y.nextInt();
if(e!=q*w)
System.out.println("回答错误!!!");
else