What is the problem with this code? It is giving timelimit exceeded (wall time): aborting command error. Please help.
#include
#include
using namespace std;
int main()
{
int num;
cin>>num;
int a=0,i,k,sum=0;
for(i=num; i!=0; i/10)
{
a++;
}
for(k=num; k!=0; k/10)
{
int b=k%10;
sum+=pow(b, a);
}
cout<<sum;
return 0;
}