Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
求助高手,错误信息是rutimeerror源代码如下: import java.util.*; public class Main { public static void main (String[] args) { String[] sc=new String[100]; Scanner sa=new Scanner(System.in); int col=sa.nextInt(); int num=sa.nextInt(); for (int i = 0; i<num; i++){ sc[i]=sa.next(); } int[] sum=new int[50]; for (int i = 0; i<num; i++) { for (int j = 0; j<col; j++){ for (int k = j; k<col; k++){ if(sc[i].charAt(j)>sc[i].charAt(k)) sum[i]++; } } } int temp=0; for (int i = 0; i<num; i++){ for(int j=0;j<num;j++){ if(sum[temp]>sum[j] ) { temp=j; } } System.out.println (sc[temp]); sum[temp]= 1500; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator