如题所述
如果你问的是:
char s[N];
scanf("%s",s);
这种情况的话,直接:
#include <string.h>//头文件
int n=strlen(s);
就行了,如果你问的是一共输入了多少,不限于一种情况,只能每输入一次就记录一下
char s[N];
scanf("%s",s);
这种情况的话,直接:
#include <string.h>//头文件
int n=strlen(s);
就行了,如果你问的是一共输入了多少,不限于一种情况,只能每输入一次就记录一下
温馨提示:答案为网友推荐,仅供参考