#include <stdio.h>
struct Bank {
char name[500];
int mobile;
float balance;
};
int main() {
int i;
struct Bank a[100];
for (i = 0; i < 3; i++) {
printf("Enter the name of person %d: ", i + 1);
gets(a[i].name);
printf("Enter the mobile of person %d: ", i + 1);
scanf("%d", &a[i].mobile);
printf("Enter the mobile of person %d: ", i + 1);
scanf("%f", &a[i].balance);
}
for (i = 0; i < 3; i++) {
puts(a[i].name);
printf("His Balance is: %f", a[i].balance);
printf("His Mobile number is : %d \n\n", a[i].mobile);
}
return 0;
}
尝试运行此用户输入请求不会像我想要的那样,只需运行它就可以理解。我做错了什么?