fnhp.net
当前位置:首页 >> 简单的jAvA程序代码 >>

简单的jAvA程序代码

public class HelloWorld{ public static void main(String[] args){ System.out.println("hello world!"); } }

package com.zpp;public class Charge { public static void main(String [] args) { if(args.length ==0) { System.out.println("parameter error!"); System.out.println("java com.zpp.Charge [int]"); return; } int min = Integer.parseInt(args[0]); double money

package com.test.javatest; import java.util.ArrayList; import java.util.List; import java.util.Random; public class Main { public static void main(String[]args){ int total = 31; int memberNum = 7; int teamNum = (int)Math.ceil(((float)total )/ memberNum);

class test{ public static void main(string[] args){ for(int i=4;i>0;i--) { for(int j=0;j

import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; public class a{ public double test(int time) { double sum=0; int i=0,k=0; i=time%60; //得到的是超出一小时的分钟数 k=time/60; //得到的是小时数 if(time<60

public class NumTest { public NumTest() { } public static void main(String[] args) { NumTest test = new NumTest(); java.util.Scanner san = new java.util.Scanner(System.in); int max = 100; System.out.print("请输入一个正整数: "); max = san.

一个判断是否为素数的小方法:public static boolean isSuSHu(int n) { for (int i = 2; i if (n % i == 0) return false; } return true; } 输出a~b之间所有素数及其平方根:public static void printAllSuShu2(int a,int b) { for (int i = a; i if (isSuSHu(i)) System.out.

1 sleep(sleeptime);2 stop();3 sleep(sleeptime);4 stop();5 new rabbit(1000,"rabbit",9);6 new tortoise(1500,"tortoise",10);7 tortoise.start();8 rabit.start(); 很基础的题目

public class TestStar { public static void main(String[] args) { String star = "*"; for (int i = 0; i < 5; i++) { if (i == 0) { System.out.print(" " + star); System.out.println(); } if (i == 1) { for (int z = 0; z < 4; z++) { System.out.print(" " + star); } System.out.

public class test1{ public test1() {} public static void main(String[] args) { char c = 'a'; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2-i; j++) { System.out.print(" "); } for (int j = 0; j < 2*i + 1; j++) { System.out.print(c); } c++; System.out.println(); } for (int i = 0;

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