C语言 菜菜菜
怎样输入6个字符串,以空格分开aabb xdsfkjs8 z1 w1589sa z0351ff *End*
#include<stdio.h> #include<string.h> int main(void) { char a[1000]; char aa[1000]; char c[] = " "; printf("请输入一串字符:"); gets(a); char *p = strtok(a,c); printf("%s ",p); p = strtok(NULL,c); while(p) { printf("%s ",p); p = strtok(NULL,c); } }
[此贴子已经被作者于2018-5-16 11:53编辑过]