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

Re:请大牛们帮忙看下为什么总是runtime error-_-!!!!! java!!

Posted by crazyyangdan at 2011-05-28 15:24:29 on Problem 1519
In Reply To:请大牛们帮忙看下为什么总是runtime error-_-!!!!! java!! Posted by:sinceowa at 2010-04-28 00:59:59
> import java.io.*;
> import java.util.*;
> class Main{
> public static void main(String[] args)throws IOException{
> Scanner s=new Scanner(new BufferedInputStream(System.in));
> int j;
> for(j=0;;j++){
> 	long m=s.nextLong();
> 	if(m==0)
> 		break; 
> 	while(m>9){
> 		long samp=0;
> 		String str=String.valueOf(m);
> 		char[] ch=str.toCharArray();
> 		for(int i=0;i<ch.length;i++){
> 			samp+=ch[i]-48; 
> 		}
> 	m=samp;	
> 	}
> System.out.println(m);
>  }
> 
> }
> }

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