问答题 请编写函数mygets和myputs,其功能分别与gets和puts相同,函数中用getchar和putchar读入和输出字符。
【正确答案】mygets和myputs函数如下: void mygets(char*s) {while((*s=getchar())!'/n')s++; *s='/0'; } void myputs(char*s) {while(*s){putchar(*s); s++; } putchar('/n'); }
【答案解析】