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

各位高手帮我看看啊,明明得到结果却说WA啊,55

Posted by lqq550220 at 2008-07-18 19:08:00
#include <iostream>
using namespace std;
int f(int n)//算n^3
{
	return n*n*n;
}

int main()
{
	int N;
	cin>>N;
        for(int i=3;i<=N;i++)
		for(int  c=N-1;c>1;c--)
		  for(int b=c;b>1;b--)
			  for(int a=b;a>1;a--)
			   if(f(i)==f(a)+f(b)+f(c))
cout<<"Cube = "<<i<<", "<<"Triple = ("<<a<<','<<b<<','<<c<<')'<<endl;
			      return 0;
}
我试过了跟给的数据一样的结果,可提交时老说WA是什么原因啊 				  

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