#include <stdio.h>#include <string.h>
int main(){ char str[]="123 12 1"; char *p; p=strtok(str, " "); printf("%s\n", p); while (p=strtok(NULL, " ")) { printf("%s\n", p); } return 0;}输出效果:
匿名回答于2019-07-03 23:33:03