Untitled

mail@pastecode.io avatar
unknown
c_cpp
19 days ago
319 B
0
Indexable
Never
#include <iostream>
#include <cmath>
using namespace std;

int col(int a) {
	int col = 0;
	if (a == 0) {
		col++;
		cout << col;
	}
	else {
		while (a != 0) {
			a /= 10;
			col++;
		}
		cout << col;
	}
	return col;
}

int main() {
	setlocale(LC_ALL, "Russian");
	int a;
	cin >> a;
	col(a);
}
Leave a Comment