• 2


    public class work {


    public static void gs(Object obj){
    System.out.println(obj);
    }
    public static void main(String[] args){

    int count = 0;
    for(int i=0;i<300;i++){
    int a = (int)(Math.random()*100);
    int b = (int)(Math.random()*100);
    int c = (int)(Math.random()*100);
    int j=1;
    if(0<=c&&c<10)
    j=1;
    else if(10<=c&&c<20)
    j=2;
    else if(20<=c&&c<30)
    j=3;
    else if(30<=c&&c<40)
    j=4;
    else if(40<=c&&c<50)
    j=5;
    else if(50<=c&&c<60)
    j=6;
    else if(60<=c&&c<70)
    j=7;
    else if(70<=c&&c<80)
    j=8;
    else if(80<=c&&c<90)
    j=9;
    else 
    j=10;
    switch(j){
    case 1:
    gs(a + "+" + b + "=");
    break;
    case 2:
    gs(a + "-" + b + "=");
    break;
    case 3:
    gs(a + "*" + b + "=");
    break;
    case 4:
    gs(a + "/" + b + "=");
    break;

    }
    count++;

    gs("一共有:"+count+"四则运算题目");
    }
    public static void jf(int a,int b){
    if(a>=b)
    gs(a + "-" + b + "=");
    else{
    gs(b + "-" + a + "=");
    }
    }
    public static void cf(int a,int b){
    if(b>0)
    gs(a + "/" + b + "=");
    else{


    b=b+1;
    gs(a + "/" + b + "=");
    }
    }

    }

  • 相关阅读:
    蛇形矩阵
    润年还是平年
    汽水瓶
    魔幻矩阵
    魔方矩阵
    时间字段替换
    Windows Server 2012 R2蓝屏
    查询速度慢的原因很多(转载)
    索引和锁
    别不拿里程碑当石头---------IT项目管理之项目计划(转)
  • 原文地址:https://www.cnblogs.com/yujunhao/p/6539441.html
Copyright © 2020-2023  润新知