import java.text.NumberFormat;
public class test1
{
public static void main(String[] args)
PIXNET
目前分類:Java (5)
- Apr 13 Fri 2007 01:20
JAVA如何設定輸出運算結果小數點後幾位
- Dec 23 Sat 2006 15:02
Char與Ascii互轉
Char與Ascii互轉
public class charCovert{
public static void main(String[] args){
AsciiToChar(65);
CharToAscii('Z');
public class charCovert{
public static void main(String[] args){
AsciiToChar(65);
CharToAscii('Z');
- Dec 23 Sat 2006 14:51
兩題Java基礎題
第一題
設計程式,利用引數輸入2個整數,然後將數字由小到大顯示出來,若相等則顯示"兩數相等"。 例如:
輸入: java Exam01 25 10
輸出:10 25輸入:java Exam01 10 25
輸出:10 25 輸入:java Exam01 25 25
- Dec 23 Sat 2006 14:48
找出質數 - 使用篩法
For given value of N (say, 30), first write down all the integers from 2 to N:
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Delete all the multiples of the first number in the sequence (2):
2 3 5 7 9 11 13 15 17 19 21 23 25 27 29
- Dec 23 Sat 2006 00:45
1+...+N - 使用三段繼承
1+...+N - 使用三段繼承
// addtoN.java
public class addtoN
{
public static void main( String[] args )