91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 13KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-06
  • 語言: C/C++
  • 標簽:

資源簡介

能完美運行 包含功能: 1、輸入:函數input把20學生的學號、姓名、性別、年齡、四科成績以及平均成績和總成績放在一個結構體數組中,學生的學號、姓名、四科成績由鍵盤輸入,然后計算出平均成績和總成績放在結構體對應的域中。 2、插入:insert 函數輸入一個學生的記錄,按學號的先后順序插入該學生的全部內容。 3、排序:sort函數對所有學生按要求排序(1.學號 2.總成績 ),并輸出。 4、查找:find函數輸入一個學生的學號或姓名,找到該學生并輸出該學生的全部內容。要求能查詢多次。 5、刪除:delete函數輸入一個學生的學號或姓名,找到該學生并刪除該學生的全部內容。 6、輸出:函數output 輸出全部學生的記錄。 7、main函數使用菜單,菜單可以調用所有函數,實現全部函數功能(注:除了定義結構外,不允許使用全局變量,函數之間的數據全部使用參數傳遞)。若出現中文亂碼可以聯系我

資源截圖

代碼片段和文件信息


#include
#include
#include
#include
#define?LEN?sizeof(struct?student)
struct?student
{
int?num;
char?name[20];
char?sex[5];
int?age;
float?score[11];
float?ave;
float?sum;
struct?student?*next?*nex;
};
void?main()
{
struct?student?*?sort(struct?student?*p?int?A?char?*o);//排序
struct?student?*insert(struct?student?*p?int?A?char?*o);//插入
void?find(struct?student?*p1?int?A?char?*o);//查找
struct?student*?delete_(struct?student?*p1);//刪除
struct?student*?start(int?A?char?*o);//啟動
void?output(struct?student?*p?int?A?char?*o);//輸出

struct?student?*head;
int?A?i?a?b=0?flag?=?1?flag1?=?1?flag2?=?1?flag3?=?1?flag4?=?0;
char?k[10][20]?*o;
o?=?k[0];
printf(“****************************************************************************************************\n“);
printf(“ ???????????\n“);
printf(“ ???????????\n“);
printf(“ ????????????????? ???????????\n“);
printf(“ ???????????\n“);
printf(“ ??? ???\n“);
printf(“****************************************************************************************************\n“);
printf(“??????γ???????????????????\n“);
scanf(“%d“?&A);
for?(i?=?0;?i {
scanf(“%s“?k[i]);
}
while?(flag)
{
flag1?=?flag2?=?flag3?=?1;
head?=?start(A?o);
head?=?sort(head?0?o);
while?(flag1)
{
flag3?=?1;
if?(flag2)
{
printf(“------------------------------------------------------------------------------\n“);
printf(“1.?????????\n2.????????????\n3.???????????\n4.????????????\n5.???????????\n6.?????????????\n7.???\n????????“);
scanf(“%d“?&a);
}
printf(“------------------------------------------------------------------------------\n“);
if?(a?==?1)?output(head?A?o);
else?if?(a?==?2)
{
head?=?sort(head?A?o);
output(head?A?o);
}
else?if?(a?==?3)?find(head?A?o);
else?if?(a?==?4)
{
head?=?insert(head?A?o);
flag4?=?1;
}
else?if?(a?==?5)
{
head?=?delete_(head);
flag4?=?1;
}
else?if?(a?==?6)?flag1?=?flag2?=?flag3?=?0;
else?if?(a?==?7)?flag?=?flag1?=?flag2?=?flag3?=?0;
else
{
printf(“?????????????????:“);
flag3?=?0;
}
while?(flag3)
{
if?(flag4)?printf(“0.??????“);
printf(“1.??????????2.????????3.???\n“);
printf(“?????“);
scanf(“%d“?&b);
if?(flag4&&b?==?0)
{
output(head?A?o);
flag4?=?0;
}
else
{
if?(b?==?1)
{
flag2?=?1;
flag3?=?0;
}
else?if?(b?==?2)?flag2?=?flag3?=?0;
else?if?(b?==?3)?flag?=?flag1?=?flag2?=?flag3?=?0;
else?printf(“?????????????????:\n“);
}
}
}
}
}

struct?student?*insert(struct?student?*p?int?A?char?*o)
{
struct?student?*?sort(struct?student?*p?int?A?char?*o);
void?ave_sum(struct?student?*p?int?A);
int?scan(struct

評論

共有 條評論

相關資源