<th id="xdj9j"><noframes id="xdj9j"><th id="xdj9j"></th>
<span id="xdj9j"><noframes id="xdj9j">
<th id="xdj9j"></th><th id="xdj9j"><noframes id="xdj9j"><span id="xdj9j"></span><th id="xdj9j"><address id="xdj9j"><th id="xdj9j"></th></address></th>
<th id="xdj9j"><noframes id="xdj9j"><span id="xdj9j"></span>
<ruby id="xdj9j"><video id="xdj9j"><strike id="xdj9j"></strike></video></ruby>
<span id="xdj9j"></span>
<progress id="xdj9j"><noframes id="xdj9j">

用結構體描述圖書的完整信息任務實現

簡介

用結構體描述圖書的完整信息任務實現

用結構體描述圖書的完整信息任務實現

步驟1:啟動Visual C++ 6.0

步驟2:新建C語言源程序文件*.c

步驟3:在C源程序文件中,輸入如下代碼:

#include <stdio.h>

struct Book{

char ISBN[14];

char Name[20];

double Price;

char Author[20];

char publish[30];

};

int main()

{

Book b;

printf("輸入編號:");

scanf("%s",b.ISBN);

printf("請輸入書名:");

scanf("%s",b.Name);

printf("請輸入價格:");

scanf("%lf",&b.Price);

printf("請輸入作者:");

scanf("%s",b.Author);

printf("請輸入出版時間:");

scanf("%s",b.publish);

printf("\n-----------------------------------\n");

printf("編號:%s\n",b.ISBN);

printf("書名:%s\n",b.Name);

printf("價格:%lf\n",b.Price);

printf("作者:%s\n",b.Author);

printf("出版時間:%s\n",b.publish);

return 0;

}

步驟4:編譯連接

步驟5:執行,運行結果如下所示:

請輸入編號:987456231231

請輸入書名:c語言程序設計↙

請輸入價格:35

請輸入作者:譚浩強↙

請輸入出版時間:2014.10.11

------------------------------------------

編號:987456231231

書名:c語言程序設計

價格:35

作者:譚浩強

出版時間:2014.10.11


評論列表

發表評論

国产成年女一区二区三区