#include "stdio.h"
#include "string.h"
struct book
{char name[50];
char auth[50];
char cbs[50];
float price;};
struct book s[5];
main()
{int i;
for(i=0;i<5;i++)
{printf("请输入书名:\n");
scanf("%s",s[i].name);
printf("请输入作者:\n");
scanf("%s",s[i].auth);
printf("请输入出版社:\n");
scanf("%s",s[i].cbs);
printf("请输入单价:\n");
scanf("%f",&s[i].price);}
for(i=0;i<5;i++)
{printf("Name=%s\n",s[i].name);
printf("Auth=%s\n",s[i].auth);
printf("Cbs=%s\n",s[i].cbs);
printf("Price=%.2f\n",s[i].price);}}
看看啊.
希望提出意见啊"!!!!