题解 | #获取字符串长度#
获取字符串长度
https://www.nowcoder.com/practice/9a2d212d23f5436c80607d5e68c6d12a
#include <stdio.h>
void get_line(char *p)
{
int count=0;
while(*p++!='\0')
{
count++;
}
printf("%d",count);
}
int main()
{
char a[100];
scanf("%[^\n]",&a);
get_line(a);
return 0;
}
字节跳动公司福利 1309人发布
