我不明白那裡出錯了, 只需要簡單輸入幾串字再 print out 出來便可以...
麻煩有誰知道錯在那裡呢? Thanks.
#include int main() { char e[10];
char f[50];
char g[50];
char h[5]; printf("Please Input name 1\n");
scanf("%s", &e); printf("Please Input name 2\n");
scanf("%s", &f); printf("Please Input name 3\n");
scanf("%s", &g); printf("Please Input name 4\n");
scanf("%s", &h); printf("name 1\t\t: %s\n", e);
printf("name 2\t: %s\n", f);
printf("name 3\t: %s\n", g);
printf("name 4\t\t: %s\n", h); /* pause the program */
getchar();
}
input:
john chan <-enter
may wong <-enter
output:
Please Input name 1
john chan
Please Input name 2
may wong
Please Input name 3
Please Input name 4
name 1 : john
name 2 : chan
name 3 : may
name 4 : wong