Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
135584 吕毅心 完美立方 C++ Accepted 12 MS 268 KB 639 2025-11-07 17:58:28

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a,b,c,d,n; cin>>n; for(a=2;a<=n;a++){ for(b=2;b<a;b++){ for(c=b+1;c<a;c++){ for(d=c+1;d<a;d++){ if(d*d*d==a*a*a-b*b*b-c*c*c){ cout<<"Cube = "<<a<<", Triple = ("<<b<<","<<c<<","<<d<<")"<<endl; } } } } } return 0; }