ddddddv
发贴: 18
积分: 0
|
于 2007-02-20 14:12
看了一篇关于这个问题的帖子,那个是忘了一个;号 我看过了 自己好象不是这原因,请各位大虾指点。初次写这个。
ublic class score { public static void main(String[] args) { int[] units={32,87,70,66,90,15, 21,88,93,75,52,30}; for(int i=0,j=1;i<units.length,j<units.length; ) { if(units[i]>=units[j]) { j++; } else { i++; } System.out.println("this is the high score"+units[i]); } for(int a=0,b=1;a<units.length,b<units.length; ) { if(units[a]<=units[b]) { b++; }else { a++; } System.out.println("this is the low score"+units[a]); } for(int c=0,d=0,e=0,f=0;c<units.length,d<units.length, e<units.length,f<units.length;c++) { if(units[c]>80) { d++; }else if (units[c]>60 && units[c]<=80) { e++; } else { f++; } System.out.println("Good="+d+" "+"Ok="+e+" "+"Bad="+f); } for(int g=0,k=1;g<units.length,k<units.length;k++) { units[g]+=units[k]; units[g]=units[g]/units.length; System.out.println("the average score is"+units[g]); } System.out.println(); } }
|