счётчик

mail@pastecode.io avatar
unknown
c_cpp
17 days ago
228 B
1
Indexable
Never
#include <iostream>
using namespace std;

int count(int a)
{
	int i = 0;
	if (a == 0) i = 1;
	else
	{
	for (; a > 0; i++)
	{
		a /= 10;
	}
	}
	return i;
}
int main()
{
	int a;
	cin >> a;
	cout << count(a);
}
Leave a Comment