tnfh.net
当前位置:首页 >> 这个jAvA编程题目怎么做? >>

这个jAvA编程题目怎么做?

一共有五个地方需要修改。代码在附件,你下载参考下。 修改的地方我都添加注释。一点一点的找错误不容易。请记得及时采...

public class Test {public static void main(String[] args) {int hour = 20000 / 3600;int minute = (20000 % 3600) / 60;int second = ((20000 % 3600) % 60);System.out.println(hour + "小时" + minute + "分" + second + "秒");}}

public class ShuiXianHua {public static void main(String[] args) {ShuiXianHua.sxh();}public static void sxh() {for (int i = 1; i < 10; i++) {for(int j = 1;j

两个代码 一个学生类, 一个测试类 你自己把他们放不同包里面 public class Student {private int Snum;private int Gnum;private String Sname;private String Ssex;private int Sage;private static int count = 0;public Student(int snum, i...

Suansu.java public class Suansu{ private int a; private int b; public Suansu(){ //构造函数 初始化a=10,b=5; this.a=10; this.b=5; } public int AddAB(){ //和 return a+b; } public int SubAB(){ //差 return a-b; } } TestSuansu.java p...

public class Testa { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("从键盘输入A的值:"); double a = scanner.nextDouble(); System.out.println("从键盘输入B的值:"); double b...

基于UDP通信,可用类创建一个对象表示一个发送数据包,这个类是() A.?DataSocket B.?DatagramSocket C.?DataPacket D.?DatagramPacket D 基于UDP通信,在创建了发送数据包的对象后,如果想获得数据包的目标端口号,可调用方法() A.?getTargetPor...

public class TestGongyue{ public static void main(String[] args){ Gongyue gy=new Gongyue(); Gongbei gb=new Gongbei(); int a=16,b=12; System.out.println(a+","+b+"公约数为:"+gy.f(a,b)); System.out.println(a+","+b+"公倍数为:"+gb...

public static void main(String[] args) { rhombus(10); } public static void rhombus(int length) { for (int i = 0; i length ? (length*2 - i) * 2 + 1 : i * 2 + 1); } } public static void blank(int length) { for (int i = 0; i < len...

亲,这样能行吗?? import java.util.Scanner;public class Test1 {public static void main(String args[]){int height;String zifu;System.out.print("请输入行高:");Scanner in=new Scanner(System.in);height=in.nextInt();System.out.prin...

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com