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

那位牛人帮忙瞅瞅啊 哪里错啦啊??为啥是Wrong answer 明明都输对了嘛

Posted by sdau_10_chaopeng at 2011-03-15 13:43:08 on Problem 1543
import java.util.Scanner;
public class Main{
	public static void main(String args[]){
		int a,b,c,d,i;
		Scanner sc = new Scanner(System.in);
		a = sc.nextInt() ;
		for(i=2;i<=a;i++)
			for(b=i;b>0;b--)
				for(c=b;c>0;c--)
					for(d=2;d<=c;d++)
						if(i*i*i==(b*b*b+c*c*c+d*d*d)){	
								System.out.println("Cube = "+i+", Triple = ("+d+","+c+","+b+")");
					}
			}
}

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