题目中“上面的for 循环语句”为:
for (i=0; i<lim-1 && (c=getchar()) != '\n' && c != EOF; ++i) s[i] = c;
简单的编写了一段程序:
#include<stdio.h> int main(){ char s[100]; int lim=100; int state=1;