a53

sumcifnrcif

a53
Dec 9th, 2020
179
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. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned long long int n;
  7. cin>>n;
  8. int s=0;
  9. while(n)
  10. s+=n%10,n/=10;
  11. int nc=0;
  12. while(s)
  13. ++nc,s/=10;
  14. cout<<nc;
  15. return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment