C++ problem

Maitha

Honorable
Apr 1, 2012
1
0
10,510
Write a program that prompts the user to enter two positive integers lower and upper, then finds and prints all numbers in the interval [lower, upper] that have the property that the cube sum of the digits equals the number itself. The program also prints the how many numbers have the cube sum property.
 

braincruser

Distinguished
Aug 26, 2011
10
0
18,570
#include<iostream>
using namespace std;
void "insert function name" (int lower, int upper){
int i,n;
n=0;
for(i=lower;i<=upper;i++){
if(digitcubesum( i )==i){
n++;
cout<<i<<endl;
}
}
cout<<"this many numbers completed the trial of fire"<<n<<endl;
}
int digitcubesum(int n){
int result=0;
int i;
i=n;
while(i>0){
result+=i%10;
i=i/10;
}
return result*result*result;
}

int main(){
int lw,up;
cout<<"Insert numero uno"<<endl;
cin>>lw;
cout<<"Insert number two"<<endl;
cin>>up;
"insert name of your primary function, same as above"(lw,up);
return 0;
}