Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求助高手,错误信息是rutimeerror

Posted by cclang at 2010-02-07 12:05:51 on Problem 1007
源代码如下:
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator