【算法代码】
#include <bits/stdc++.h>
using namespace std;int year=2025;
int main() {cout<<year<<" = ";int i=1;while(year) {cout<<i<<"^3";if(i<9) cout<<" + ";year-=pow(i,3);i++;}return 0;
}/*
2025 = 1^3 + 2^3 + 3^3 + 4^3 + 5^3 + 6^3 + 7^3 + 8^3 + 9^3
*/
【运行截图】