Определить количество цифр в числе введенном с клавиатуры
Visual C++

Ответы

Ответ дал: Andrey05
20
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int a,k(0);
    cout << "a="; cin >> a;
    while (a > 0)
    {
        a /= 10;
        k++;
    }
    cout << "Otvet: " << k << endl;
    return 0;
}

Вас заинтересует