fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int r,n,i,temp,len=0,x=0;
  7. cin>>n;
  8. temp=n;
  9. for(i=0; i<3; i++)
  10. {
  11. r=n%10;
  12. x+=(r*r*r);
  13. n=n/10;
  14. cout<<r<<" "<<n<<" "<<x<<"\n";
  15. }
  16. if(temp==x)
  17. cout<<"yes\n";
  18. else
  19. cout<<"no\n";
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 15232KB
stdin
153
stdout
3 15 27
5 1 152
1 0 153
yes