solution:

#include<iostream>

#include<string>

using namespace std;

int getLastDigit(int & num)

{

int r=num%10;

num=num/10;

return r;

}

bool IsCube(int A[], int num,int count )

{

int sum=0;

while(count>=0)

{

sum=(A[count]*A[count]*A[count])+sum;

count--;

}

if(num==sum)

return true;

return false;

}

void main()

{

int A[100]={0};

int start=0;

int end=0;

int temp=0;

int i=0;

cout<<"first number:";cin>>start;

cout<<"second number:";cin>>end;

if(start>end)

{

cout<<"\nInvalid Interval\n";

exit(0);

}

for(int num=start; num<=end; num++)

{

i=0;

temp=num;

while(1)

{

A=getLastDigit(temp);

if(temp==0)

break;

i++;

}

if(IsCube(A,num,i))

cout<<num<<" is a cubic sum\n";

}

}