C语言第8章习答案.docVIP

  • 22
  • 0
  • 约1.37万字
  • 约 11页
  • 2016-10-12 发布于贵州
  • 举报
C语言第8章习答案

第八章 8.1 用一个数组存放图书信息,每本书是一个结构,包括下列几项信息:书名、作者、出版年月、借出否,试写出描述这些信息的说明,并编写一个程序,读入若干本书的信息,然后打印出以上信息。#include stdio.h typedef struct { char Name[20]; char Author[20]; int Date_Year; int Date_Month; int loaned; } BOOK; #define N 10 void main() { BOOK books[N]; int i; for (i=0;iN;i++) { printf(Input Books Name:); gets(books[i].Name); printf(Input Books Author:); gets(books[i].Author); printf(Input Books Year of Publishing:); scanf(%d,books[i].Date_Year); printf(Input Books Month of Publishing:); scanf(%d,books[i].Date_Month); printf(Input Books Status, 1-Loaned, 2-K

文档评论(0)

1亿VIP精品文档

相关文档