程序功能:字符串的输入和输出 程序特点:程序比较简单,主要是介绍getchar和puts这两个库函数的调用 #include <stdio.h> int main() { char c; char string[30]; int i=0 ; puts( "please type the string" ); while ( (c=getchar()) != '/n' ) { string[i] = c; i++; } string[i] = '/0'; puts( "the string you type just now is" ); puts( string ); return 0; }