程序目的:
#include <iostream>
using namespace std;
void main()
{
int x = 0, y = 0, z = 0;
int t = 0;
for (int i = 100; i <= 999; i++)
{
t = i;
for (int j = 0; j < 3; j++)
{
x = t % 10;
y += x*x*x;
t /= 10;
if (y == i)
cout << y << endl;
}
y = 0;//注意每次用完都要重置y
}
system("pause");
}
y=0;