input.c
This commit is contained in:
parent
cd429b004d
commit
0f3d08a827
16
c04_string/input.c
Normal file
16
c04_string/input.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user