xcxd.net
当前位置:首页 >> 编写一个jAvA程序 >>

编写一个jAvA程序

public class SuShu { public static void main(String[] args) { int n=0;//记录1000以内素数的个数 int m=0;//记录数字能被几个数整除 for(int i=200;i<301;i++){ for(int j=1;j<=i;j++){ if(i%j==0){ m++;//如果i能被j整除,则计一次 } } if(m==2){//如

import java.util.Date; class Telephone{ private String brand; private String phoneNum; private int seconds; private double rate; public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String

public class Teststudent { public static void main(String[] args) { Student stu = new Student("Zhang San", 'F', 12345); stu.setAddress("Guang zhou"); stu.setClass("021"); stu.setId(2345); System.out.println(stu.toString()); } } class Student {

import java.util.*; public class ManyClasses { public static void main(String args[]) { int st[]=new int[3]; for(int i=0;i<3;i++) { st[i]=Integer.parseInt( args[i]); //转换 } Arrays.sort(st); //排序 System.out.println("最大值="+st[2]); System.out.

import java.util.ArrayList;import java.util.List; public class Add { public static void main(String[] args){ int n=42339; List a=new ArrayList(); a.add(n/10000); n%=10000; a.add(n/1000); n%=1000; a.add(n/100); n%=100; a.add(n/10); n%=10; a.add(n);

public class Demo3 { public static void main(String[] args) { byte a =1; short b=1; int c = 1; long d = 1l; float e=1f; double f =1; char g ='1'; boolean h = true; System.out.println("byte a ="+a); System.out.println("short b="+b); System.out.println("int

public class Test{ int length; int wide; int height; public Test() { } int cout(int a,int b,int c) { int count = 0; length = a; wide = b; height = c; count = length*wide*height; return count; } void output(int count) { System.out.println("体积:"+count); } public

class Trangle{ private double a, b, c;//三个边 private double area;//面积 private double perimeter;//周长 public double getArea() {//返回面积 return area; } public double getPerimeter() {//返回周长 return a+b+c; } public void setA(double a)

楼上正解class T{ public static void main(String[] args) { if(141.2+102.3+118.9+135.1>500) System.out.println("已达目标"); else System.out.println("未到目标"); }} class T{ public static void main(String[] args) { for(int i=1000;i<2000;i++) if(i%3==0)System.out.print (i+" "); }}

import java.util.*; public class yugi{ public static void main(string[] args){ scanner scan = new scanner(system.in); system.out.println("输入班级人数:"); int num = scan.nextint(); double sum = 0; double max = double.min_value; double min =

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