24h購物| | PChome| 登入
2007-04-08 15:43:11| 人氣137| 回應1 | 上一篇 | 下一篇

我寫的程式

推薦 0 收藏 0 轉貼0 訂閱站台

import java.io.*;

public class Main {



public static void main(String[] args) throws java.io.IOException{

Score student;
student = new Score();
student.Input01();
}



}
class Score{
private final int MAX =5;
void Input01()throws java.io.IOException{
int[] score1 = new int [MAX];

java.io.BufferedReader keyin;
keyin = new java.io.BufferedReader(
new java.io.InputStreamReader(System.in));
int x= 0,count=0;
do{
System.out.println(”請輸入五個分數,或輸入-1結束”);
x = Integer.parseInt(keyin.readLine());
score1[count++]=x;

if(count>=MAX){
x=-1;
System.out.println(”最多輸入”+MAX+”個分數”);
}
}while(x!=-1);
for (int i=0;i System.out.println(score1[i]);
}
}

}

台長: 愛到星星人
人氣(137) | 回應(1)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: 電腦 |

隱姓埋名
==什麼怪東西
2007-04-08 22:51:11
版主回應
這是JAVA的程式
2007-04-09 21:53:39
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文