业余求学吧 关注:2贴子:206
  • 0回复贴,共1

【程序调试】字符串长度

只看楼主收藏回复

测输入的字符串的长度
#include<stdio.h>
#include<string.h>
void main()
{
int k;
static char st1[30];
printf("input a string\n");
gets(st1);
k=strlen(st1);
printf("the lenth of the string is %d\n",k);
}

输入zifuchuanchangdu


IP属地:浙江1楼2014-01-25 09:51回复