| ||||||||||
| 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 | |||||||||
各位高手帮我看看啊,明明得到结果却说WA啊,55#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator