Advertisement
elynx

Untitled

Nov 26th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int ccount(int &a) {
  5. int count = 0;
  6. if (a == 0) {
  7. cout << 1;
  8. }
  9. while (a != 0) {
  10. a /= 10;
  11. count++;
  12. }
  13. return count;
  14. }
  15. int main()
  16. {
  17. int a;
  18. cin >> a;
  19. cout << ccount(a);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement