#include <stdio.h>
int main(void){
int age;
float assets;
char pet[30]; // string
printf("Enter your age, assets, and favorite pet./n");
scanf("%d %f", &age, &assets); // use the & here
scanf("%s", pet); // no & for char array
printf("%d $%.2f %s/n", age, assets, pet);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/266523.html