c语言大作业旋转,c语言大作业全-20210412035629.docx-原创力文档
Document number:PBGCG-0857-BTDO-0089-PTT1998
Document number:PBGCG-0857-BTDO-0089-PTT1998
C語言大作業全
#include ""
#include ""
#include ""
#include ""
#include ""
#define LEN sizeof(struct student)
#define NULL 0
int n,m;
int k=1;
struct student
{char num[20];
char name[20];
int age;
char profession[50];
int maths;
int english;
int C_program;
float ave;
struct student * next;
};
float ave(struct student * p1)
{
float ave;
ave=(float)(p1->maths+p1->english+p1->C_program)/3;
return ave;
}
void save(struct student *head)
{
struct student *p1 = head;
FILE *outFile;
outFile = fopen("", "wb");
if (outFile == NULL) {
printf("\nFile error.");
}
else {
while(p1 != NULL)
{
fwrite(p1, sizeof(struct student), 1, outFile);
p1 = p1->next;
}
fclose(outFile);
}
}
;
}
else {
head = (struct student *)malloc(sizeof(struct student));
fread(head, sizeof(*head), 1, infile);
p2 = head;
while(fread(&record, sizeof(record), 1, infile));
}
fwrite(p1, sizeof(struct student), 1, outFile);
fclose(outFile);
}
void sta(struct student * head,char array[20],int max,int min)
{
struct student *p1=head;
int k=0;
if(strcmp(array,"maths")==0)
{
while(p1!=NULL)
{
if(p1->maths>=min&&p1->maths<=max)
k++;
p1=p1->next;
}
printf("數學科目在%d到%d之間的人數為:%d\n",min,max,k);
}
else if(strcmp(array,"english")==0)
{
while(p1!=NULL)
{
if(p1->english>=min&&p1->english<=max)
k++;
p1=p1->next;
}
printf("英語科目在%d到%d之間的人數為:%d\n",min,max,k);
}
else if(strcmp(array,"C_program")==0)
{
while(p1!=NULL)
{
if(p1->C_program>=min&&p1->C_program<=max)
k++;
p1=p1->next;
}
printf("C語言科目在%d到%d之間的人數為:%d\n",min,max,k);
}
}
void exit()
{
printf("\t\t");printf("**********************\n");
printf("\t\t");printf("*******感謝使用*******\n");
printf("\t\t");printf("**********************\n");
k=0;
}
void Chooseproject(int i)
{ struct student *
總結
以上是生活随笔為你收集整理的c语言大作业旋转,c语言大作业全-20210412035629.docx-原创力文档的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《三体》真人版电视剧首播口碑出炉 网友直
- 下一篇: 小编要失业了 美国科技媒体CNET用AI