zoukankan      html  css  js  c++  java
  • 第一周

    思路:定义三个随机数,其中两个作为计算数据,另一个mol4取余定义运算符号。

    Java源代码如下:

    public class jisuan

    {

     

        public static void main(String[] args)

        {

        int a,b,c,i;

        for(i=0;i<30;i++)

        {

            a=(int)(Math.random()*100);

            b=(int)(Math.random()*100);

            c=(int)(Math.random()*100);

            c=c%4;

            if(c==0) System.out.println(i+1+":"+a+"+"+b+"=");

            if(c==1) System.out.println(i+1+":"+a+"-"+b+"=");

            if(c==2) System.out.println(i+1+":"+a+"*"+b+"=");

            if(c==3) System.out.println(i+1+":"+a+"/"+b+"=");

        }

     

        }

     

    }

    课堂上对于生成随机数函数不了解,网上查询相关资料掌握。

  • 相关阅读:
    人月神话读书笔记
    读人月神话有感
    Codeforces 137D
    Codeforces 1138B
    <WFU暑假训练一> 解题报告
    Codeforces 1250B
    Codeforces 1038D
    Codeforces 1202D
    Codeforces 87B
    Codeforces 208C
  • 原文地址:https://www.cnblogs.com/BUANG/p/4319040.html
Copyright © 2011-2022 走看看