宣告Declaration | scanf() 輸入 | printf() 輸出 | |
1 | int x; | scanf("%i",&x); | printf("Number = %i \n",x); |
2 | float x; | scanf("%f",&x); | printf("%f",x); |
宣告Declaration | scanf() 輸入 | get?() | fget?() | |
3 | char x; | scanf("%c",&x);
fscanf(stdin,"%c",&x); |
x=getc(stdin);
x=getchar(); x=getche(); x=getch(); |
x=fgetc(stdin);
x=fgetchar(); --- --- |
4 | char x[10]; | scanf("%s",x);
fscanf(stdin,"%s",x); |
gets(x); --- |
--- fgets(x,sizeof(x),stdin); |
宣告Declaration | printf() 輸出 | put?() | fput?() | |
5 | char x; | printf("%c",x);
fprintf(stdout,"%c",x); |
putc(x,stdout);
putch(x); putchar(x); |
fputc(x,stdout);
--- --- |
6 | char x[10]; | printf("%s",x);
fprintf(stdout,"%s",x); |
puts(x); --- |
--- fputs(x,stdout); |
.
.