?? insert.h
字號:
#include "data.h"
#include "string.h"
/*輸入函數*/
/*
char GName[20];//存儲國家的名稱
char GContinent[20];//存儲國家所屬的洲
int Goldplate;//金牌數量
int Silvermedal;//銀牌數量
int Cuprumplate;//銅牌數量
int Integral;//記錄國家的積分情況
char ItemNum[10];//項目編號
char ItemName[20];//項目名稱
char GoldAthleteName;//金牌選手姓名
char SilverAthleteName;//銀牌選手姓名
char CuprAthleteName;//銅牌選手姓名
char AthleteCity;//選手國籍
*/
void Create()
{
int i;
for(i=0;i<N;i++)
{
printf ("Enter the [%d] 請輸入國家的姓名:\t\t",i+1);
fflush(stdin);
gets(Country[i].GName);
printf ("Enter the [%d] 請輸入國家屬于那個洲:\t",i+1);
fflush(stdin);
gets(Country[i].GContinent);
printf ("Enter the [%d] 請輸入國家取得金牌數量:\t",i+1);
fflush(stdin);
scanf ("%d",&Country[i].Goldplate);
printf ("Enter the [%d] 請輸入國家取得銀牌數量:\t",i+1);
fflush(stdin);
scanf ("%d",&Country[i].Silvermedal);
printf ("Enter the [%d] 請輸入國家取得銅牌數量:\t",i+1);
fflush(stdin);
scanf ("%d",&Country[i].Cuprumplate);
printf ("Enter The [%d] 此國家積分是:\t\t%d\n",i+1,Country[i].Integral=Country[i].Goldplate*5+Country[i].Silvermedal*3+Country[i].Cuprumplate*2);
fflush(stdin);
printf("\n");
}
for(i=0;i<M;i++)
{
printf ("請輸入項目編號:\t",i+1);
fflush(stdin);
gets(Item[i].ItemName);
printf ("請輸入項目名稱:\t",i+1);
fflush(stdin);
gets(Item[i].ItemName);
printf ("請輸入金牌獲得者:\t");
fflush(stdin);
gets(Item[i].GoldAthleteName);
printf ("請輸入銀牌獲得者:\t");
fflush(stdin);
gets(Item[i].SilverAthleteName);
printf ("請輸入銅牌獲得著:\t");
fflush(stdin);
gets(Item[i].CuprAthleteName);
printf ("請輸入選手的國家:\t");
fflush(stdin);
gets(Item[i].AthleteCity);
printf("\n");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -