practice_code/c/code/bilibili/digui.c

20 lines
322 B
C
Raw Normal View History

2023-12-07 21:45:29 +08:00
#include <stdio.h>
int my_strlen(char* str )
{
if(*str != '\0')
{
return 1+ my_strlen (str+1);
}
else
return 0;
}
int main ()
{
char arr[99];
printf("请输入你要计算数字的长度:");
scanf("%s",arr);
printf ("%d",my_strlen(arr));
return 0;
2023-12-07 19:19:14 +08:00
}