首页 > 其他分享 >九月二十三日

九月二十三日

时间:2023-09-22 22:23:07浏览次数:35  
标签:square int double System public 二十三日 static 九月

动手动脑1

随机生成1000个随机数

public class Main {


    static int x=1;
    public  static void  f(int count)
    {
        for(int i=0;i<count;i++)
        {
            x=(16807 * x + 1) % Integer.MAX_VALUE;
            System.out.println(x);
        }
    }


    public static void main (String[] args)
    {
        int count=1000;
        f(count);
    }

}

 

动手动脑2

函数重载

public class Main {
    public static void main(String[] args) {
        System.out.println("The square of integer 7 is "+square(7));
        System.out.println("The square of double 7 is "+square(7.5));
    }
    
    public static int square(int x){
        return x*x;
    }
    
    public static double square(double x){
        return x*x;
    }
}

  

   

标签:square,int,double,System,public,二十三日,static,九月
From: https://www.cnblogs.com/youxiandechilun/p/17723514.html

相关文章

  • 九月二十二日
    将数据结构学了一下回文数用栈和双向链表的方式都实现了一下#include<iostream>usingnamespacestd;typedefstruct{chardata[101];inttop;}SqStack;voidInitStack(SqStack&S){S.top=-1;}voidPush(SqStack&S,chare){S.data[++S.top]=e......
  • 九月二十日
    下载VScode学习javaweb收拾一下心情,删除一些游戏 <!--文档类型为HTML--><!DOCTYPEhtml><htmllang="en"><head><!--设置字符集为UTF-8--><metacharset="UTF-8"><!--设置浏览器的兼容性--><metaname=&quo......
  • 每日打卡 周三 九月二十日
    今天就早上八点有一节课,完课后回到宿舍,最近有点感冒,大概10点到宿舍,躺在床上就睡过去了,起来就该吃午饭。下午本应该学习javaweb但是一直没有状态,只看了一会就感到头晕,躺在床上又睡过去了,起来天已经黑了,简单对付几口,吃过药就没有再出宿舍了。......
  • 九月十九日(舔狗代码)
    #include<iostream>#include<easyx.h>#include<ctime>#include<windows.h>#pragmacomment(lib,"winmm.lib")#include<mmsystem.h>usingnamespacestd;voiddrawImg_s(intx,inty,IMAGE*img);voidbackground();v......
  • 每日打卡 周一 九月十八日
    今天在java课上的练习题,有一个要求控制输入时间限制。 intcount=90;//倒计时90秒Timertimer=newTimer(); TimerTasktask=newTimerTask(){ publicvoidrun(){ if(count>0) { System.out.println("倒计时:"+count); count-=10; } ......
  • 九月十二日星期一
    今天在建明哥课上学习了编程思想,我自己领略到到就是解决任何问题都本质方法就是分解为自己看的懂得小问题,所以我认为概括力跟抽象物体的能力是一个优秀程序员必备的技能,同时这两个个能力投入到现实项目中是依赖于交流能力的,所以我认为要想成为一个优秀的程序工程师既要有出众的抽......
  • 九月十四号
    #include<iostream>usingnamespacestd;structNode{intdata;Node*next;};structList{Node*head;intlength;};intmain(){ListL;L.head=nullptr;L.length=0;intn;cin>>n;Node*current=nullptr;......
  • 九月十三号
    #include<iostream>usingnamespacestd;longlongf(longlonga){longlongday=0; if(a<=5) { return1; } else { a=a-5; day+=1; while(1) { day+=a/4; if(a%4>0) { returnday+1; } if(a%4==0) { returnday; } } }}intm......
  • 每日打卡 周二 九月十二日
    今天下午没有课,中午睡觉起来先玩了一会儿,然后开始在网上学习javaweb的相关内容,先是看视频解决了severs的问题,有一个eclipse自带的,还可以找其他浏览器,例FireFox...然后根据视频讲解又更换了ecilpse的版本,现在是2022-12的。......
  • 每日打卡 周一 九月十一日
    今天下午的Java语言课堂小测试,我成为最后的几名,主要是定义Stringx,没有初始化,导致代码一直报错,这让我以后对此格外注意。晚上写作业的时候,有关结构体的题不会写,上网查找了相关知识,就算又学习一遍基础的结构体定义即应用。......