This commit is contained in:
wandoubaba517 2023-12-05 21:27:06 +08:00
parent cd429b004d
commit 0f3d08a827

16
c04_string/input.c Normal file
View File

@ -0,0 +1,16 @@
/* input.c - 何时使用& */
#include <stdio.h>
int main(void)
{
int age;
float assets;
char pet[30];
printf("Enter your age, assets, and favorite pet.\n");
scanf("%d %f", &age, &assets);
scanf("%s", pet);
printf("%d $%.2f %s\n", age, assets, pet);
return 0;
}