#include <bits/stdc++.h> #include #include #include #include #include #include #include #include using namespace std; int n; int main(){ cin>>n; for(int c=2;c<=n;c++){ for(int i=2;i<=c;i++){ for(int j=2;j<=i;j++){ for(int k=2;k<=j;k++){ if(iii+jjj+kkk==ccc) cout<<"Cube = "<<c<<", Triple = ("<<i<<","<<j<<","<<k<<")"<<endl; } } } }
}
共 1 条回复
建议使用 markdown 格式,然后这题要求从小到大输出,你应该
cout << k << j << i;