Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int ccount(int &a) {
- int count = 0;
- if (a == 0) {
- cout << 1;
- }
- while (a != 0) {
- a /= 10;
- count++;
- }
- return count;
- }
- int main()
- {
- int a;
- cin >> a;
- cout << ccount(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement