Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,k=0;
  8. cin>>n;
  9. if(n==0)
  10. k=1;
  11. else
  12.  
  13. while(n>0)
  14. {
  15. k++;
  16. n=n/10;
  17. }
  18.  
  19. cout<<k;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement