标签:ble 运算 class mat port engine main rand random
import java.util.*; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.util.Scanner; public class Double { public static void main(String[] args) { int a1,a2,a3,a4; int b1,b2,b3,b4; int m,n; int i=0; Scanner sc=new Scanner(System.in); String f[]=new String[4]; f[0]="+"; f[1]="-"; f[2]="*"; f[3]="/"; System.out.println("请选择10以内或100以内"); m=sc.nextInt()+1; System.out.println("请输入要产生的题数"); n=sc.nextInt(); for(i=0;i<n;i++) { a1=(int)(Math.random()*m); a2=(int)(Math.random()*m); a3=(int)(Math.random()*m); a4=(int)(Math.random()*m); b1=(int)(Math.random()*4); b2=(int)(Math.random()*4); b3=(int)(Math.random()*4); System.out.println("第"+(i+1)+"题:"+a1+f[b1]+a2+f[b2]+a3+f[b3]+a4+"="); } } }
标签:ble 运算 class mat port engine main rand random
原文地址:https://www.cnblogs.com/zmh-980509/p/9751809.html