Skip to content

Commit

Permalink
Update getchar.c
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiahan2018 committed Nov 2, 2018
1 parent 4cc5e47 commit 1892c0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions getchar.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*getchar*/
/*getchar*/
#include <stdio.h>
int main()
{
int a,b,c;/* getchar从标准输入(stdin)读入字符,标准输入是行缓冲的,也就是你输入回车后,
或者缓冲区满了,系统才读 */
int a,b,c;/* getchar从标准输入(stdin)读入字符,标准输入是行缓冲的,也就是你输入回车后,
或者缓冲区满了,系统才读 */
char string[10];
while ((a = getchar()) != '\n') //getchar用while循环读入缓冲区的值,直到遇到回车
while ((a = getchar()) != '\n') //getchar用while循环读入缓冲区的值,直到遇到回车
scanf("%s",&b);

printf("%c", a); //输出
printf("%c", a); //输出
return 0;
}

Expand Down

0 comments on commit 1892c0b

Please sign in to comment.