• 怎么为学生布置作业


    package text1;

    public class P1 {
    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 + "=");
    }
    }

    }

  • 相关阅读:
    UVA11825 Hackers' Crackdown
    UVA 11346 Probability
    Codeforces 12 D Ball
    bzoj 4766: 文艺计算姬
    Codeforces 757 F Team Rocket Rises Again
    [HAOI2011] problem C
    Atcoder 3857 Median Sum
    bzoj4399 魔法少女LJJ
    bzoj2638 黑白染色
    bzoj4197 [Noi2015]寿司晚宴
  • 原文地址:https://www.cnblogs.com/xw12/p/6549944.html
Copyright © 2020-2023  润新知