Determine whether it is a three-digit number daffodils

bool NarcissisticNumber(int n)
{
int a,b,c;
a=n%10;
b=(n%100)/10;
c=n/100;
if((aaa+bbb+ccc)==n)
return true;
else
return false;
}

Published 45 original articles · won praise 36 · views 835

Guess you like

Origin blog.csdn.net/huangziguang/article/details/104399818