一 一

来源:互联网 发布:stc15w104编程 编辑:程序博客网 时间:2024/04/26 14:58
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,m;
for (a=6;a<=200;++a)
{
        m=a*a*a;
for (b=2;b<a;++b)
{
for (c=b;c<a;++c)

for (d=c;d<a;++d)
{
   if (m==b*b*b+c*c*c+d*d*d)
    cout<<"Cube = "<<a<<","<<" Tripe = "<<"("<<b<<","<<c<<","<<d<<")"<<endl;
}
}
}
}
   return 0; 
}
原创粉丝点击