Run ID:7151

提交时间:2025-04-05 14:14:02

#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 n,a=1,b=1,c=1,d=1; cin>>n; for(a=2;a<=n;a++){ for(b=2;b<=n;b++){ for(c=2;c<=n;c++){ for(d=2;d<=n;d++){ if(a*a*a == b*b*b + c*c*c + d*d*d && b<=c && c<=d){ cout<<"Cube = "<<a<<", Triple = ("<<b<<","<<c<<","<<d<<")"<<endl; } } } } } return 0; }