當前位置:首頁 » 課程大全 » 運動會的課程設計c

運動會的課程設計c

發布時間: 2021-03-15 01:07:31

❶ C++課程設計:運動會分數統計

main()
{int i,c; /*c為項目編號*/

printf("********************************************************\n");
printf(" C程序語言課程設計------運動會分數統計\n");
printf(" 設計人: 班\n");
printf("********************************************************\n");
printf("請輸入參加運動會的學校個數:");
scanf("%d",&n);
printf("\n有多少個男子項目:");
scanf("%d",&m);
printf("\n有多少個女子項目:");
scanf("%d",&w);
printf("\n本次運動會有%d個學校參加,共設%d個比賽項目,其中男子項目%d個,女子項目%d個。\n",n,m+w,m,w);

printf("請輸入比賽結果資料\n");
for(i=0;i<m+w;i++)
ma[i].matnum=i+1; /*初始化項目編號*/

c=1; /*初始化c*/
while(c!=0)
{printf("\n請輸入已結束的比賽項目編號(0=COTINUE):");
scanf("%d",&c);
if((c>0)&&(c<=m+w))
input?; /*調用輸入函數*/
else if(c==0) break;
else printf("\n!error:輸入的數應為1-%d之間的整數!\n",m+w); /*輸入出錯信息*/
}
printf("\nLoading......\n"); /*稍後*/

index(); /*調用整理函數*/
teamsco(); /*調用團體成績計算函數*/

teamput(); /*調用輸出團體報表函數*/

c=1; /*初始化c*/
while(c!=0)
{printf("\n\n請輸入學校編號查詢成績列表(0=EXIT):");
scanf("%d",&c);
if(c==0) break;
else if((c>=0)&&(c<=m+w))
output?; /*調用輸出學校成績列表函數*/
else printf("\n!error:輸入的數應為1-%d之間的整數!\n",m+w); /*輸入出錯信息*/
}
system("cls");/*清屏函數*/ /*這個地方有些問題,我換了一個系統函數*/
printf("\n謝謝!請多多指教!\n");
getch();
exit(1);/*如果不用這條可能出現問題*/
return;}

❷ 一個較為典型的c語言課程設計題目:校際運動會管理系統

include "stdio.h" /*I/O函數*/
#include "stdlib.h" /*其它說明*/
#include "string.h" /*字元串函數*/
#include "conio.h" /*屏幕操作函數*/
#include "mem.h" /*內存操作函數*/
#include "ctype.h" /*字元操作函數*/
#include "alloc.h" /*動態地址分配函數*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please shuru wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please shur huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];
fwrite(&data,sizeof(data),1,fp);
printf("another?y/n");
ch=getch();
if(ch=='n'||ch=='N')
break;
} fclose(fp);
}
void xianshi()
{
float s;int n;
if((fp=fopen("s_score.txt","rb+"))==NULL)
{
printf("Cannot reading this file.\n");
exit(0);
}
for(i=0;i<=1000;i++)
{
if((fread(&info[i],sizeof(info[i]),1,fp))!=1)
break;
}
printf("\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n");
for(j=0,k=1;j<i;j++,k++)
{
info[j].mingci=k;
printf("%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n",info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],
info[j].score[5]);
}
getch();
fclose(fp);
}

void xiugai()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("Cannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xiugai xuehao:");
scanf("%d",&i); getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{
printf("xuehao:%s\nmingzi:%s\n",data.xuehao,data.mingzi);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please input wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please input huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(&data,sizeof(data),1,fp1);
}
fseek(fp,0L,0);
fseek(fp1,0L,0);
while((fread(&data,sizeof(data),1,fp1))==1)
{
fwrite(&data,sizeof(data),1,fp);
}

fclose(fp);
fclose(fp1);
}
void chazhao()
{
if((fp=fopen("s_score.txt","rb"))==NULL)
{
printf("\nCannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xuehao chakan:");
scanf("%d",&i);
while(fread(&data,sizeof(data),1,fp)==1)
{
j=atoi(data.xuehao);
if(i==j)
{
printf("xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);
}getch();
}
}
void shanchu()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("\nopen score.txt was failed!");
getch();
exit(0);
}
printf("\nPlease input ID which you want to del:");
scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{

printf("Anykey will delet it.\n");
getch();
continue;
}
fwrite(&data,sizeof(data),1,fp1);
}
fclose(fp);
fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n");
printf("Anykey will return to main.");
getch();
}
main()
{
while(1)
{
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移動游標*/
textcolor(YELLOW); /*設置文本顯示顏色為黃色*/
textbackground(BLUE); /*設置背景顏色為藍色*/
window(1,1,99,99); /* 製作顯示菜單的窗口,大小根據菜單條數設計*/
clrscr();
printf("*************welcome to use student manage******************\n");
printf("*************************menu********************************\n");
printf("* ========================================================= * \n");
printf("* 1>shuru 2>xiugai * \n");
printf("* 3>shanchu 4>chazhao * \n");
printf("* 5>xianshi 6>exit * \n");
printf("* * \n");
printf("* --------------------------------------------------------- * \n");
printf(" Please input which you want(1-6):");
ch=getch();
switch(ch)
{
case '1':shuru();break;
case '2':xiugai(); break;
case '3':shanchu(); break;
case '4':chazhao(); break;
case '5':xianshi(); break;
case '6':exit(0);
default: continue;
}
}

❸ C語言課程設計 運動會學生成績管理系統 現在下面部分程序中加入 按姓名查找功能,求高手解答

voidselect1(structstudent*p)//按姓名查詢
{
intm;
m=N;
chary[10];
printf("請輸入學生的姓名是: ");
scanf("%s",y);
for(p=stu;p<stu+m;p++)
{
if(strcmp(p->name,y)==0)//字元串比較函數
{
p->aver=(p->score[0]+p->score[1]+p->score[2])/3;
printf("學號:%s姓名:%s高數:%d大物:%d英語:%d平均分:%f ",p->num,p->name,p->score[0],p->score[1],p->score[2],p->aver);
}
}
}

以前寫的回學生成績管理系統的答。

你適當改一改吧。

❹ c語言課設 運動會成績管理系統

807712443,qq聯系吧

❺ C語言課程設計 運動會學生成績管理系統 將下面程序添加成績由高到低,由低到高排名兩項功能。

咋不能運行,錯了好多

❻ C語言課程設計~~~ 要求編寫一段程序,題目是《校際運動會管理系統》

我這是源代碼已經調試過了,在VC++上運行成功了。
#include "stdio.h" /*I/O函數*/
#include "stdlib.h" /*其它說明*/
#include "string.h" /*字元串函數*/
#include "conio.h" /*屏幕操作函數*/
#include "mem.h" /*內存操作函數*/
#include "ctype.h" /*字元操作函數*/
#include "alloc.h" /*動態地址分配函數*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please shuru wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please shur huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];
fwrite(&data,sizeof(data),1,fp);
printf("another?y/n");
ch=getch();
if(ch=='n'||ch=='N')
break;
} fclose(fp);
}
void xianshi()
{
float s;int n;
if((fp=fopen("s_score.txt","rb+"))==NULL)
{
printf("Cannot reading this file.\n");
exit(0);
}
for(i=0;i<=1000;i++)
{
if((fread(&info[i],sizeof(info[i]),1,fp))!=1)
break;
}
printf("\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n");
for(j=0,k=1;j<i;j++,k++)
{
info[j].mingci=k;
printf("%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n",info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],
info[j].score[5]);
}
getch();
fclose(fp);
}

void xiugai()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("Cannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xiugai xuehao:");
scanf("%d",&i); getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{
printf("xuehao:%s\nmingzi:%s\n",data.xuehao,data.mingzi);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please input wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please input huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(&data,sizeof(data),1,fp1);
}
fseek(fp,0L,0);
fseek(fp1,0L,0);
while((fread(&data,sizeof(data),1,fp1))==1)
{
fwrite(&data,sizeof(data),1,fp);
}

fclose(fp);
fclose(fp1);
}
void chazhao()
{
if((fp=fopen("s_score.txt","rb"))==NULL)
{
printf("\nCannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xuehao chakan:");
scanf("%d",&i);
while(fread(&data,sizeof(data),1,fp)==1)
{
j=atoi(data.xuehao);
if(i==j)
{
printf("xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);
}getch();
}
}
void shanchu()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("\nopen score.txt was failed!");
getch();
exit(0);
}
printf("\nPlease input ID which you want to del:");
scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{

printf("Anykey will delet it.\n");
getch();
continue;
}
fwrite(&data,sizeof(data),1,fp1);
}
fclose(fp);
fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n");
printf("Anykey will return to main.");
getch();
}
main()
{
while(1)
{
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移動游標*/
textcolor(YELLOW); /*設置文本顯示顏色為黃色*/
textbackground(BLUE); /*設置背景顏色為藍色*/
window(1,1,99,99); /* 製作顯示菜單的窗口,大小根據菜單條數設計*/
clrscr();
printf("*************welcome to use student manage******************\n");
printf("*************************menu********************************\n");
printf("* ========================================================= * \n");
printf("* 1>shuru 2>xiugai * \n");
printf("* 3>shanchu 4>chazhao * \n");
printf("* 5>xianshi 6>exit * \n");
printf("* * \n");
printf("* --------------------------------------------------------- * \n");
printf(" Please input which you want(1-6):");
ch=getch();
switch(ch)
{
case '1':shuru();break;
case '2':xiugai(); break;
case '3':shanchu(); break;
case '4':chazhao(); break;
case '5':xianshi(); break;
case '6':exit(0);
default: continue;
}
}

❼ 急求C語言課程設計答案。題目:運動會分數統計

有償 可聯系 看ID

❽ 求C語言課程設計 運動會管理系統

搞訴我地址,我可以發給你
試試這個,論文也有
#include<stdio.h>
#define A 100
int y=0,f=0,j,W,M,N,p[15],q[15];
struct student
{ char shool[20];
char name[20];
char item[20];
char sex;
int position;
int mark;
}stu[A];

struct item
{ char name[20];
char sex;
int mark;
}it[A];

struct shool
{ char name[20];
char item[20];
int mark;
}sho[A];

main()
{
menu();
}

menu()
{ int w1,n;
do
{ puts("\t\t*****************MENU********************");
puts("\n\n\t\t 1.The information to writein\n");
puts("\t\t 2.The race result records to writein\n");
puts("\t\t 3.Search the information\n");
puts("\t\t 4.Exit\n");
puts("\n\t\t*****************************************");
puts("\n\nChoice you number:");
scanf("%d",&n);
if(n<1||n>4){w1=1;getchar();}
else w1=0;
}while(w1==1);
switch(n)
{ case 1:establish();break;
case 2:enter();break;
case 3:search();break;
case 4:exit(0);
}
}

establish()
{ int h,r; extern N,M,W;
y=1;
printf("\nThe number of shool attended is:");
scanf("%d",&N);
printf("\nThe number of men item is:");
scanf("%d",&M);
printf("\nThe number of women item is:");
scanf("%d",&W);
printf("\nThere are three form of marked you can choice:");
printf("\n\n\t1).1th--7,2th--5,3th--3,4th--2,5th--1.");
printf("\n\n\t2).1th--5,2th--3,3th--1.");
printf("\n\n\t3).Define by youself.");
loop: printf("\n\nChoice the number(1--3):");
scanf("%d",&h);
if(h>0&&h<4)
switch(h)
{case 1:j=1;break;
case 2:j=2;break;
case 3:define_mark();
}
else goto loop;
printf("Success!!!\nPress any key+Enter to menu..");scanf("%d",&r);
menu();
}

enter()
{ int t,r,i=0;extern j,y;char F,M;
if(y==0)
{ printf("Please establish system first!!\nPress any key+Enter to menu.. ");
scanf("%d",&r);
menu();
}
do
{
printf("\nPlease enter the student's name:\t");scanf("%s",&stu[i].name);
printf("\nPlease enter the student's shool:\t");scanf("%s",&stu[i].shool);
printf("\nPlease enter the student's item:\t");scanf("%s",&stu[i].item);
loop_1: printf("\nPlease enter the student's sex(W or M):\t");scanf("%s",&stu[i].sex);
if(stu[i].sex!='W'&&stu[i].sex!='M')goto loop_1;
printf("\nPlease enter the student's position:\t");scanf("%d",&stu[i].position);
mark(j,i);
loop_2:printf("\n\nDo again?\t1).Yes\t2).No\t");
scanf("%d",&t);
if(t!=2&&t!=1)goto loop_2;
if(t==2)break;
i++;
}while(t==1);f=1;
printf("Success!!!\nPress any key+Enter to menu..");scanf("%d",&r);
menu();
}

search()
{ int e;char c;extern f;
if(f==0)
{ printf("Please enter the data first!!\nPress any key+Enter to menu..\n ");
scanf("%s",&c);
menu();
}
loop:printf("\nThe form of searching you want to choice:\n\t1).By school\n\t2).Bt item\n\t3).To menu\t");
scanf("%d",&e);
switch(e)
{ case 1:search_school();break;
case 2:search_item();break;
case 3:menu();
}
if(e>4||e<1)goto loop;
printf("Press any key+Enter to menu..");scanf("%s",&c);menu();
}

search_school()
{ int x,sum=0,w=0;
struct student s;
printf("\nPlease enter the name of the school that you want to search:");
scanf("%s",&s.shool);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.shool,stu[x].shool)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{printf("\n\n*The name is wrong,press again!");search_school();}

}

search_item()
{ int x,sum=0,w=0;
struct student s;
printf("\nPlease enter the name of the item that you want to search:");
scanf("%s",&s.item);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.item,stu[x].item)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{ printf("\n\n*The name is wrong,press again!");search_item();}

}
mark(int j,int i)
{ int g; extern p[15],q[15];
if(j==1)
{if(stu[i].position==1)stu[i].mark=7;
else if(stu[i].position==2)stu[i].mark=5;
else if(stu[i].position==3)stu[i].mark=3;
else if(stu[i].position==4)stu[i].mark=2;
else if(stu[i].position==5)stu[i].mark=1;
}
if(j==2)
{ if(stu[i].position==1)stu[i].mark=5;
else if(stu[i].position==2)stu[i].mark=3;
else if(stu[i].position==3)stu[i].mark=1;
}
if(j==3)
{ for(g=0;g<15;g++)if(stu[i].position==p[g])stu[i].mark=q[g];}

}

define_mark()
{ static int p[15],q[15],a,b,j;
for(a=0;a<15;a++)
{ printf("\nThe position(1--15):");scanf("%d",&p[a]);
printf("\nThe mark you want to define(Integral):");scanf("%d",&q[a]);
loop:printf("\nDo you want define more:\t1).Yes\t2).No");scanf("%d",&b);
if(b==2)break;
if(b!=1)goto loop;
}
j=3;
}

printf_one(int x)
{ printf("\n%-20s%-20s%-20s%-5c%-9d%-5d",stu[x].shool,stu[x].name,stu[x].item,stu[x].sex,stu[x].position,stu[x].mark);
}

printf_sum(int sum)
{ printf("\n\nThe sum of mark is:\t %d",sum);
printf("\nThe shool number is: \t%d",N);
printf("\nThe item number is: \t%d\n",W+M);
}
printf_face()
{ printf("\n\nSchool name student name item sex position mark");
}

❾ c語言課程設計。 校際運動會管理系統 一、題目要求 (1)信息初始化 輸入:N─參賽

會管理系統 一、題目要求 (1)信息初始化 輸入:N─參賽
當然的

❿ C語言課程設計 要求編寫一段程序 題目是《運動會分數統計系統》

不錯,我會把題弄回家試試的.
你要等我,等我哦,我一定會回來的.
ka~~~
導演,我的二分是不是到手了?
(tt)p
開心一下,有機會大家研究研究.

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919