A-A+
以下程序的功能是计算字符串的长度。请填空。#include<stdio.h>main(){c
问题详情
以下程序的功能是计算字符串的长度。请填空。
#include<stdio.h>
main()
{char str[100],*sp=str;
int nlen=0;
scanf("%s",str);
for(;*sp!="";sp++)______;
printf("%d",nlen);
}
参考答案
正确答案:
nlen++ [解析] 利用字符串结束标志'\0',nlen是计数器。