#include <stdio.h>
#include <stdlib.h>
int calculate(int n){
if(n==0){
return 1;
}
if(n==1){
return 1;
}
else return n*calculate(n-1);
}
int main(int argc, char *argv[])
{
int number = 9;
int result = calculate(number);
int count=0;
printf("myNumber=======%d\n", result);
while(1){
result=result%10;
printf("result========%d\n",result);
count++;
if(result==0){
break;
}
}
printf("result========%d\n",count);
system("pause");
return;
}
求阶乘数包含0的个数
最新推荐文章于 2021-06-17 22:45:35 发布