Run ID:8113

提交时间:2025-06-14 15:56:00

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