freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

歌曲信息管理系統(tǒng)-資料下載頁

2024-08-17 01:09本頁面
  

【正文】 oid printf_one(int i) { printf(\n%s %s %s %s\n,so[i].name,so[i].creater,so[i].singer,so[i].date)。 }輸入一個完整記錄函數(shù)該函數(shù)的作用是分別提示用戶來輸入一首歌的各個信息,包括歌曲名,作者,演唱者,日期。用到的是scanf printf 函數(shù)。void input(int i) { printf(\nname: )。 scanf(%s,so[i].name)。 printf(\ncreater: )。 scanf(%s,so[i].creater)。 printf(\nsinger: )。 scanf(%s,so[i].singer)。 printf(\ndate: )。 scanf(%s,so[i].date)。} 保存函數(shù)該函數(shù)是首先打開文件,如果沒有就新建一個,以只寫的方式,通過循環(huán)向文件中寫入歌曲信息。void save(int n) { FILE *fp。 int i。 if((fp=fopen(,w))==NULL) { printf(\nCannot open file\n)。 exit(1)。 } for(i=0。in。i++) { fprintf(fp,%s %s %s %s\n,so[i].name,so[i].creater,so[i].singer,so[i].date)。 } fclose(fp)。} 返回上一級函數(shù)該函數(shù)就是向用戶提示一個成功并調(diào)用menu()函數(shù)返回主菜單。void printf_back() { void menu()。 printf(\n\n\t成功\n\n)。 menu()。} 加載函數(shù)該函數(shù)的作用是首先打開文件,然后從文件中用fscanf函數(shù)調(diào)出歌曲信息,完成后用fclose關(guān)閉文件。 int load(){ FILE *fp。 int i。 if((fp=fopen(,r))==NULL) { printf(\nCannot open file\n)。 return 0。 } for(i=0。!feof(fp)。i++) { fscanf(fp,%s %s %s %s ,so[i].name,so[i].creater,so[i].singer,so[i].date)。 } fclose(fp)。 return(i)。} 顯示數(shù)據(jù)結(jié)構(gòu)項目函數(shù)該函數(shù)的作用就是通過一個printf函數(shù)顯示出歌曲信息的表頭。void printf_face(){ printf(\nname creater singer date\n)。} 顯示刪除數(shù)據(jù)函數(shù) int shan_chue_data(int j,int n){ FILE *fp。 int i。 if((fp=fopen(,w))==NULL) { printf(\nCannot open file\n)。 exit(1)。 } for(i=0。in。i++) { if(i!=j) fprintf(fp,%s %s %s %s\n,so[i].name,so[i].creater,so[i].singer,so[i].date)。 } fclose(fp)。 return 1。程序運行 下面是各個模塊的界面圖主菜單函數(shù)輸入模塊在主界面出現(xiàn)后輸入1按回車看到下圖: 輸入要輸入的歌曲記錄數(shù)然后逐條增加,如下圖: 輸入2后返回主菜單再輸入3進入瀏覽模塊 輸入4進入查找模塊 按歌曲名查找回主菜單后輸入5進入分組模塊返回主菜單后輸入2進入刪除模塊
點擊復(fù)制文檔內(nèi)容
化學(xué)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1