简单的程序参考:#include <stdio.h>#include <string.h>int main(){ char s[151],a[100]; int i,maxlen; char *p; gets(s); p = strtok(s, " "); maxlen=strlen(p); do { if(maxlen<strlen(p)) { maxlen=strlen(p); strcpy(a,p); } } while((p = strtok(NULL, " ."))!=NULL); printf("%s\n",a); return 0;}例样测试结果