Steven_Tian
unread,Nov 9, 2010, 3:51:33 AM11/9/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Good Ideas
//最下面有一個括號被隱藏住了,記得加上去
public class A49827201 {
public static void main(String[] argv) {
int[] students = { 11,31,25,40,65,63,72,40,90,100 };
int fail=0;
int pass=0;
for (int i = 0; i < students.length; i++) {
System.out.println((i + 1) + " --- " + students[i]);
if(students[i]>60){
pass=pass+1;
}else if(students[i]<60){
fail= fail+1;
}
}
System.out.println("-------------------------------");
System.out.println("及格 : " + pass);
System.out.println("不及格 : " + fail);
System.out.println("-------------------------------");
}
}