Minor corrections

This commit is contained in:
2019-09-28 12:10:24 +02:00
parent ec1d1fa446
commit 68b33e946c
4 changed files with 12 additions and 2 deletions

View File

@ -49,6 +49,11 @@ int main(int argc, char **argv)
int count_digits(int n)
{
int i = 0;
if(n == 0)
{
return 1;
}
while(n > 0)
{

View File

@ -67,6 +67,11 @@ int count_digits(mpz_t n)
int count = 0;
mpz_t value;
if(mpz_cmp_ui(n, 0) == 0)
{
return 1;
}
mpz_init_set(value, n);
while(mpz_cmp_ui(value, 0))