大一c语言课程设计报告简单,c语言课程设计报告

1,c语言课程设计报告并命名为PersonInfo.txt【大一c语言课程设计报告简单,c语言课程设计报告】
2,c语言课程设计报告怎么写我怎么发给你?课程设计,我知道怎么安排,了解 怎么做的就怎么写,代码,最好加必要的解释,然后就是运行结果,最后就是自己的体会感想啦
3,c语言课程设计void dlt(char str[],int n,int m){int i;for(i=n;istr[j]) { c=str[j]; str[j]=str[i]; str[i]=c; } }
4,C语言课程设计tc2.0编译通过(这里我假设4门课为a,b,c,d)代码如下:#include#include #include #define LONG sizeof(struct student) char allmax_name[20]; int allmax_score=0; int maxa_number,maxb_number,maxc_number,maxd_number; int maxa_score=0,maxb_score=0,maxc_score=0,maxd_score=0; int i; struct student {char name[20]; int number, a,b,c,d; struct student *next; }; struct student *head,*p1,*p2; struct student *input() {for(i=1;i<=5;i++) {p2=(struct student *)malloc(LONG); if(i==1)head=p2,p1=p2; printf("\n input student%d name number a b c d: ",i); scanf("%s %d %d %d %d %d",p2->name,&p2->number,&p2->a,&p2->b,&p2->c,&p2->d); p1->next=p2; p1=p2; } return head; } void student_all(struct student *head) {int sum; p1=head; for(i=1;i<=5;i++) {sum=p1->a+p1->b+p1->c+p1->d; printf("\n %s allscore: %d",p1->name,sum); if(sum>allmax_score)allmax_score=sum,strcpy(allmax_name,p1->name); p1=p1->next; } } void c_average(struct student *head) {double sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0; p1=head; for(i=1;i<=5;i++) {sum1+=p1->a; sum2+=p1->b; sum3+=p1->c; sum4+=p1->d; if(p1->a>maxa_score)maxa_score=p1->a,maxa_number=p1->number; if(p1->b>maxb_score)maxb_score=p1->b,maxb_number=p1->number; if(p1->c>maxc_score)maxc_score=p1->c,maxc_number=p1->number; if(p1->d>maxd_score)maxd_score=p1->d,maxd_number=p1->number; p1=p1->next; } printf("\n average_a: %.1f \n average_b: %.1f \n average_c: %.1f \n average_d: %.1f",sum1/5,sum2/5,sum3/5,sum4/5); } void allmax() {printf("\n The allmax_score is %s allmax_score: %d",allmax_name,allmax_score); } void permax() { printf("\n The maxa student number: %d maxa_score: %d",maxa_number,maxa_score); printf("\n The maxb student number: %d maxb_score: %d",maxb_number,maxb_score); printf("\n The maxc student number: %d maxc_score: %d",maxc_number,maxc_score); printf("\n The maxd student number: %d maxd_score: %d",maxd_number,maxd_score); } void main() {input(); student_all(head); c_average(head); allmax(); permax(); printf("\n Press any key to exit"); getche(); }http://www.dreamblow.cn/default.asp?cateID=18这个里面有源代码的5,C语言课程设计哈哈,去年我同学让我替他编写过#include <malloc.h>#include <stdio.h>#include <stdlib.h>#define LEN sizeof(struct scorenode)#define DEBUG#include <string.h>struct scorenodechar name[10];/*姓名*/float yuwen;/*语文成绩*/float yingyu;/*英语成绩*/float shuxue;/*数学成绩 */struct scorenode *next;};typedef struct scorenode score;int n,k;/*n,k为全局变量 , 本程序中的函数均可以使用它*//*==============================================================================================*/score *creat2311(void)/*函数creat2311,功能:创建链表,此函数带回一个指向链表头的指针*/score*head;score *p1,*p2,*p3,*max;int i,j;float fen;char t[10];n=0;p1=p2=p3=(score *)malloc(LEN);head=p3; /*开辟一个新单元*/printf("请输入学生资料 , 输0退出!\n");repeat1: printf("请输入学生学号(学号应大于0):");/*输入学号,学号应大于0*/scanf("%d",&p1->number);while(p1->number<0)printf("输入错误,请重新输入学生学号:");scanf("%d",&p1->number);}/*输入学号为字符或小于0时 , 程序报错,提示重新输入学号*/if(p1->number==0)goto end;/*当输入的学号为0时 , 转到末尾,结束创建链表*/elsep3=head;if(n>0)p3=p3->next;elsegoto repeat1;/*当输入的学号已经存在,程序报错 , 返回前面重新输入*/}}}}printf("请输入学生姓名:");scanf("%s",&p1->name);/*输入学生姓名*/printf("请输入语文成绩(0~100):");/*输入语文成绩,成绩应在0-100*/scanf("%f",&p1->yuwen);while(p1->yuwen<0||p1->yuwen>100)printf("输入错误,请重新输入语文成绩");/*输入错误,重新输入语文成绩直到正确为止*/scanf("%f",&p1->yuwen);}printf("请输入英语成绩(0~100):");/*输入英语成绩,成绩应在0-100*/scanf("%f",&p1->yingyu);while(p1->yingyu<0||p1->yingyu>100)printf("输入错误,请重新输入英语成绩");/*输入错误,重新输入英语成绩直到正确为止*/scanf("%f",&p1->yingyu);}printf("请输入数学成绩(0~100):");/*输入数学成绩,成绩应在0-100*/scanf("%f",&p1->shuxue);while(p1->shuxue<0||p1->shuxue>100)printf("输入错误,请重新输入数学成绩");scanf("%f",&p1->shuxue);}/*输入错误,重新输入数学成绩直到正确为止*/head=NULL;while(p1->number!=0)n=n+1;if(n==1)head=p1;elsep2->next=p1;p2=p1;p1=(score *)malloc(LEN);printf("请输入学生资料,输0退出!\n");repeat2:printf("请输入学生学号(学号应大于0):");scanf("%d",&p1->number);/*输入学号 , 学号应大于0*/while(p1->number<0)printf("输入错误,请重新输入学生学号:");scanf("%d",&p1->number);}/*输入学号为字符或小于0时,程序报错,提示重新输入学号*/if(p1->number==0)goto end;/*当输入的学号为0时,转到末尾,结束创建链表*/elsep3=head;if(n>0)p3=p3->next;elsegoto repeat2;/*当输入的学号已经存在,程序报错,返回前面重新输入*/}}}}printf("请输入学生姓名:");scanf("%s",&p1->name);/*输入学生姓名*/printf("请输入语文成绩(0~100):");scanf("%f",&p1->yuwen);/*输入语文成绩,成绩应在0-100*/while(p1->yuwen<0||p1->yuwen>100)printf("输入错误 , 请重新输入语文成绩");scanf("%f",&p1->yuwen);}/*输入错误 , 重新输入语文成绩直到正确为止*/printf("请输入英语成绩(0~100):");scanf("%f",&p1->yingyu);/*输入英语成绩,成绩应在0-100*/while(p1->yingyu<0||p1->yingyu>100)printf("输入错误,请重新输入英语成绩");scanf("%f",&p1->yingyu);}/*输入错误,重新输入英语成绩直到正确为止*/printf("请输入数学成绩(0~100):");scanf("%f",&p1->shuxue);/*输入数学成绩,成绩应在0-100*/while(p1->shuxue<0||p1->shuxue>100)printf("输入错误,请重新输入数学成绩");scanf("%f",&p1->shuxue);}/*输入错误,重新输入数学成绩直到正确为止*/}end: p1=head;p3=p1;for(i=1;i<n;i++)for(j=i+1;j<=n;j++)max=p1;p1=p1->next;if(max->number>p1->number)k=max->number;max->number=p1->number;p1->number=k;/*交换前后结点中的学号值,使得学号大者移到后面的结点中*/strcpy(t,max->name);strcpy(max->name,p1->name);strcpy(p1->name,t);/*交换前后结点中的姓名 , 使之与学号相匹配*/fen=max->yuwen;max->yuwen=p1->yuwen;p1->yuwen=fen;/*交换前后结点中的语文成绩,使之与学号相匹配*/fen=max->yingyu;max->yingyu=p1->yingyu;p1->yingyu=fen;/*交换前后结点中的英语成绩,使之与学号相匹配*/fen=max->shuxue;max->shuxue=p1->shuxue;p1->shuxue=fen;/*交换前后结点中的数学成绩 , 使之与学号相匹配*/}}max=head;p1=head;/*重新使max,p指向链表头*/} p2->next=NULL;/*链表结尾*/printf("输入的学生数为:%d个!\n",n);return(head);}/*==============================================================================================*//*==============================================================================================*/score *load2311(score *head)/*函数load2311,功能:从文件读入学生记录*/int m=0;char filepn[10];FILE *fp;printf("请输入文件路径及文件名:");scanf("%s",filepn);/*输入文件路径及名称*/if((fp=fopen(filepn,"r+"))==NULL)printf("不能打开文件!\n");return 0;}fscanf(fp,"考试成绩管理系统\n");fscanf(fp,"作者:周纯钢 班级:信息023学号:11 \n");fscanf(fp,"-----------------------------------------\n");fscanf(fp,"|学号\t|姓名\t|语文\t|英语\t|数学\t|\n");fscanf(fp,"-----------------------------------------\n");/*读入表格域*/printf("考试成绩管理系统\n");printf("作者:周纯钢 班级:信息023学号:11 \n");printf("-----------------------------------------\n");printf("|学号\t|姓名\t|语文\t|英语\t|数学\t|\n");printf("-----------------------------------------\n");/*打印表格域*/m=m+1;if(m==1)p1=(score *)malloc(LEN); /*开辟一个新单元*/fscanf(fp,"%d%s%f%f%f",&p1->number,p1->name,&p1->yuwen,&p1->yingyu,&p1->shuxue);printf("|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|\n",p1->number,p1->name,p1->yuwen,p1->yingyu,p1->shuxue);/*文件读入与显示*/head=NULL;don=n+1;if(n==1) head=p1;else p2->next=p1;p2=p1;p1=(score *)malloc(LEN);/*开辟一个新单元*/fscanf(fp,"%d%s%f%f%f\n",&p1->number,p1->name,&p1->yuwen,&p1->yingyu,&p1->shuxue);printf("|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|\n",p1->number,p1->name,p1->yuwen,p1->yingyu,p1->shuxue);/*文件读入与显示*/}while(!feof(fp));p2->next=p1;p1->next=NULL;n=n+1; }printf("-----------------------------------------\n");/*表格下线*/fclose(fp);/*结束读入,关闭文件*/return (head);}/*==============================================================================================*//*==============================================================================================*/score *add2311(score *head,score *stu)/*函数add2311,功能:追加学生资料,并且将所有学生资料按学号排序*/score *p0,*p1,*p2,*p3,*max;int i,j;float fen;char t[10];p3=stu=(score *)malloc(LEN);/*开辟一个新单元*/printf("\n输入要增加的学生的资料!");repeat4: printf("请输入学生学号(学号应大于0):");scanf("%d",&stu->number);/*输入学号 , 学号应大于0*/while(stu->number<0)printf("输入错误 , 请重新输入学生学号:");scanf("%d",&stu->number);}/*输入错误,重新输入学号*//******************************************************/if(stu->number==0)goto end2;/*当输入的学号为0时 , 转到末尾,结束追加*/elsep3=head;if(n>0)p3=p3->next;elsegoto repeat4;/*当输入的学号已经存在,程序报错,返回前面重新输入*/}}}}/******************************************************/printf("输入学生姓名:");scanf("%s",stu->name);/*输入学生姓名*/printf("请输入语文成绩(0~100):");scanf("%f",&stu->yuwen);/*输入语文成绩 , 成绩应在0-100*/while(stu->yuwen<0||stu->yuwen>100)printf("输入错误,请重新输入语文成绩");scanf("%f",&stu->yuwen);}/*输入错误,重新输入语文成绩直到正确为止*/printf("请输入英语成绩(0~100):");scanf("%f",&stu->yingyu);/*输入英语成绩,成绩应在0-100*/while(stu->yingyu<0||stu->yingyu>100)printf("输入错误,请重新输入英语成绩");scanf("%f",&stu->yingyu);}/*输入错误 , 重新输入英语成绩直到正确为止*/printf("请输入数学成绩(0~100):");scanf("%f",&stu->shuxue);/*输入数学成绩,成绩应在0-100*/while(stu->shuxue<0||stu->shuxue>100)printf("输入错误,请重新输入数学成绩");scanf("%f",&stu->shuxue);}/*输入错误 , 重新输入数学成绩直到正确为止*/p1=head;p0=stu;if(head==NULL)else/*原来链表不为空*/if(p1->next==NULL)/*找到原来链表的末尾*/p1->next=p0;p0->next=NULL;/*将它与新开单元相连接*/}elsewhile(p1->next!=NULL)/*还没找到末尾,继续找*/p2=p1;p1=p1->next;}p1->next=p0;p0->next=NULL;}}n=n+1;

    推荐阅读