Untitled
unknown
plain_text
2 years ago
252 B
3
Indexable
#include <iostream> using namespace std; int count_of_digits(int a) { int temp = a; int count = 0; while (temp > 0) { temp /= 10; count += 1; } return count; } int main() { int a; cin >> a; int res = count_of_digits(a); cout << res; }
Editor is loading...
Leave a Comment