时间:2021-01-06 11:21:35 | 栏目:C代码 | 点击:次
name=qizexi sex=man
#include<string.h> #include<stdio.h> int main(int argc, char *argv[]) { char str[128]; while (fgets(str, 127, stdin)) { char *tmp = NULL; //去掉换行符 if (tmp = strstr(str, "\n")) *tmp = '\0'; //去掉回车符 if (tmp = strstr(str, "\r")) *tmp = '\0'; printf("---%s---\n", str); } return 0; }