/* Programa que conta os números de dígitos de um inteiro. */
#include<stdio.h>
#include<locale.h>
int main(int argc, const char* argv[])
{
long long num1, num2;
int cont = 0;
printf("Por favor, digite um número inteiro: \n");
num2 = num1;
while( num2 != 0 ){
num2 = num2 / 10;
cont+=1;
}
printf("O número de digitos em %lld é %d.\n",num1
,cont
);
return 0;
}
LyogUHJvZ3JhbWEgcXVlIGNvbnRhIG9zIG7Dum1lcm9zIGRlIGTDrWdpdG9zIGRlIHVtIGludGVpcm8uICovCgojaW5jbHVkZTxzdGRpby5oPgojaW5jbHVkZTxsb2NhbGUuaD4KCmludCBtYWluKGludCBhcmdjLCBjb25zdCBjaGFyKiBhcmd2W10pCnsKICBzZXRsb2NhbGUoTENfQUxMLCJwb3J0dWd1ZXNlIik7CiAgbG9uZyBsb25nIG51bTEsIG51bTI7CiAgaW50IGNvbnQgPSAwOwogIAogIHByaW50ZigiUG9yIGZhdm9yLCBkaWdpdGUgdW0gbsO6bWVybyBpbnRlaXJvOiBcbiIpOwogIHNjYW5mKCIlbGxkIiwmbnVtMSk7CiAgCiAgbnVtMiA9IG51bTE7CiAgCiAgd2hpbGUoIG51bTIgIT0gMCApewogICAgbnVtMiA9IG51bTIgLyAxMDsKICAgIGNvbnQrPTE7CiAgfQogIHByaW50ZigiTyBuw7ptZXJvIGRlIGRpZ2l0b3MgZW0gJWxsZCDDqSAlZC5cbiIsbnVtMSxjb250KTsKICAKICByZXR1cm4gMDsKfQ==