是菜鸟吗?
点赞 1

相关推荐

package com.company;import java.util.*;//题目一class student{    private String name;    private String xingbie;    private int year,month,day,age;    private String sub;    public void add(int x,int y,int z,String a,String b,String c,int age)    {        year=x;month=y;day=z;name=a;xingbie=b;sub=c;this.age=age;    }    public void p()    {        System.out.print("subject:"+sub+",name:"+xingbie+",Sex:"+xingbie+",birth:"+year+"/"+month+"/"+day+",age:"+age);    }}//题目二class vechile{    private double speed;    private int power;    public void getpower(int x)    {        power=x;    }    public void getspeed(double x)    {        speed=x;    }    public void upspeed()    {        speed+=10;        System.out.printf("%lf",speed);    }    public void lowspeed()    {        speed-=10;        System.out.printf("%lf",speed);    }}//题目三class child{    private String name;    private String xingbie;    private int age,num;    private String habbit;    void add(int num,String name,int age,String habbit,String xingbie)    {        this.age=age;        this.habbit=habbit;        this.num=num;        this.xingbie=xingbie;        this.name=name;    }    public void p()    {        System.out.print("**第"+num+"位**\n");        System.out.println(name+"小朋友:"+xingbie+","+age);        System.out.println("兴趣爱好"+habbit);    }}//题目四class hws{    private int num;    public void add(int x)    {        num=x;    }    public void judge()    {        int[] a = new int[1000];        int jishu=0;int j=num;int l=0;        while(j!=0)        {            jishu++;            a[++l]=j%10;            j/=10;        }        int num1=jishu/2;boolean l1=flase;        for(int i=1;i        {            if(a[i]==a[jishu-i+1])            continue;            else {                l1=true;                break;            }        }        if(l1==flase)            System.out.println("Yes");        else            System.out.println("No");    }}//题目五class cai{    private int num;    public void add(int x)    {        num=x;    }    void caishuzi(int x)    {         if(x>num) {                System.out.println("猜大了");                int a=s.nextint()                caishuzi(a);            }    }}public class Main{    public static void main(String[] arges){     Scanner s=new Scanner(System.in);     System.out.printf("2304010103胡琦\n");     student a=new student();     a.add(2004,6,9,"小胡","男","计算机科学与技术",20);     a.p();     vechile b=new vechile();     int power=s.nextInt();     b.getpower(power);     double speed=s.nextDouble();     b.getspeed(speed);     b.lowspeed();     b.upspeed();     child c=new child();     c.add(1,"小胡",20,"打游戏","男");}}
点赞 评论 收藏
分享
牛客网
牛客企业服务