學校運動會管理c語言
① c語言校運會管理系統程序設計
c語言校運會任務可完成
② C語言程序設計開發學校運動會管理系統
我給你發一個吧, 不過很久以前寫的不知道還有用不,你自己修改一下 ,應該能行
③ 用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++編程,是校園運動會系統管理,一定的是C++的,不能用C語言,要求如下:
一個系統管理的軟體,代碼量很大!使用C++的意思是要使用創建相關的類處理問題,而不是簡單面向過程處理。這個幫不了你,因為代碼量真的太多了,而且很費時間。沒人願意重頭幫你做的。
⑤ 【求助】C語言【運動會管理系統】的程序設計,進來幫忙謝謝大家謝謝 !!!!要求用文見typedef
有點復雜,是什麼考試題目吧,還是畢業設計
⑥ C語言設計一個校運動會成績管理程序···求大神幫幫忙QAQ代碼最好有注釋··謝謝了!
很願意幫助你私聊
⑦ 用C語言設計開發學校運動會管理系統。
#include<stdio.h>#include<conio.h>#include<stdlib.h>#include<string.h>
#define SIZE 16#define N 4#define WM 3
void bsxm();void csxx();void Information();void main();void menu();void printf_back();void saveathlete();void saveprogram();void saveschool();void savescore();void Search();void ttzf();
int i;FILE *fp1,*fp2,*fp3,*fp4;
struct athlete //定義運動員信息{ char univ[5]; char name[16]; char prog[15]; char mingci[5]; int score; int age[16];} at[SIZE];
struct xuexiao //定義系{ char univ[5]; char prog[15]; int num_athlete;} xx[N];
struct program //定義項目信息
{ char prog[5]; int quming; char ath1[5]; char ath2[5]; char univ1[5]; char univ2[5];} pro[WM];struct zongfen //定義系得分信息
{
char univ[5]; char prog1[5]; char prog2[5]; char prog3[5]; int score1; int score2; int score3; int total_score;} zf[N];
void Information(){ int n,w; do { puts("\n\n\n"); puts("歡迎進入信息錄入功能!\n"); puts("目錄\n"); puts("1.錄入運動員信息\n"); puts("2.錄入系信息\n"); puts("3.錄入項目信息()\n"); puts("4.後退\n"); puts("\n"); printf("選擇功能(1-4):[ ]\b\b"); scanf("%d",&n); if (n<1||n>4) { w=1; getchar(); } else w=0; } while (w==1); switch(n) { case 1 :saveathlete();break;// 保存運動員信息子函數 case 2 :saveschool();break;//保存系信息子函數 case 3 :saveprogram();break;//保存項目比賽信息子函數 case 4 :exit(0); }}
void saveathlete() //保存運動員信息子函數
{ printf("\n請輸入各項目獲獎運動員的信息:"); for(i=0; i<SIZE; i++) { printf("\n請輸入第%d個運動員的信息:\n",i+1); printf("姓名:"); scanf("%s",at[i].name); printf("年齡: "); scanf("%d",at[i].age); printf("系:"); scanf("%s",at[i].univ); printf("參賽項目:"); scanf("%s",at[i].prog); printf("名次:"); scanf("%s",at[i].mingci); printf("得分:"); scanf("%d",&at[i].score); }
fp1=fopen("ath","w"); for(i=0; i<SIZE; i++) { if(fwrite(&at[i],sizeof(struct athlete),1,fp1)!=1) printf("錯誤!\n"); } fclose(fp1); fp1=fopen("ath","r for(i=0; i<SIZE; i++)"); printf("\n現在各運動員的信息如下:\n\n"); printf("姓名 年齡 系別 項目 名次 得分\n");
{ fread(&at[i],sizeof(struct athlete),1,fp1); printf("%-10%ds%-10s%-18s%-10s%d\n",at[i].name,at[i].age,at[i].univ,at[i].prog,at[i].mingci,at[i].score); } fclose(fp1); printf_back();}
void saveschool() //保存系信息子函數
{ printf("\n請輸入各參賽系別的信息:"); for(i=0; i<N; i++) { printf("\n請輸入第%d個系別的信息:\n",i+1); printf("系:"); scanf("%s",xx[i].univ); printf("參賽的項目:"); scanf("%s",xx[i].prog); printf("參賽者數:"); scanf("%d",&xx[i].num_athlete); }
fp3=fopen("xxiao","w"); for(i=0; i<N; i++) { if(fwrite(&xx[i],sizeof(struct xuexiao),1,fp3)!=1) printf("錯誤!\n"); } fclose(fp3); printf_back();}
void saveprogram() //保存項目比賽信息子函數{ printf("\n請輸入關於比賽項目的信息:"); for(i=0; i<WM; i++) { printf("\n請輸入第%d項比賽的信息:\n",i+1); printf("項目:"); scanf("%s",pro[i].prog); printf("取分情況:"); scanf("%d",&pro[i].quming); printf("參賽者:"); scanf("%s",pro[i].ath1); printf("所屬學校:"); scanf("%s",pro[i].univ1); printf("參賽者:"); scanf("%s",pro[i].ath2); printf("所屬學校:"); scanf("%s",pro[i].univ2); }
fp4=fopen("pr","w"); for(i=0; i<N; i++) { if(fwrite(&pro[i],sizeof(struct program),1,fp4)!=1) printf("錯誤!\n"); } fclose(fp4); printf_back();}
void savescore() //保存學校得分情況子函數{ printf("N-參賽學校總數,M-男子競賽項目數,W-女子競賽項目數。\n"); printf("W.100-女子一百米比賽,M.100-男子一百米,M.200-男子兩百米。\n"); printf("\n各項名次得分權值如下:\n"); printf("取前三名:第一名5分 第二名3分 第三名2分\n"); printf("\n請輸入各學校的得分情況:"); for(i=0; i<N; i++) { printf("\n請輸入第%d個得分情況:\n",i+1); printf("學校:"); scanf("%s",zf[i].univ); printf("參賽項目1:"); scanf("%s",zf[i].prog1); printf("得分:"); scanf("%d",&zf[i].score1); printf("參賽項目2:"); scanf("%s",zf[i].prog2); printf("得分:"); scanf("%d",&zf[i].score2); printf("參賽項目3:"); scanf("%s",zf[i].prog3); printf("得分:"); scanf("%d",&zf[i].score3); zf[i].total_score=zf[i].score1+zf[i].score2+zf[i].score3; } fp2=fopen("zfen","w"); for(i=0; i<N; i++) { if(fwrite(&zf[i],sizeof(struct zongfen),1,fp2)!=1) printf("錯誤!\n"); } fclose(fp2); printf_back();}
void Search(){ int n,w2; do { puts("歡迎進入查詢功能!\n"); puts("目錄\n"); puts("1.查詢團體總分\n");//查看團體總分 puts("2.查詢參賽學校信息\n");//查看參賽學校信息! puts("3.查詢比賽項目信息\n");//查看比賽項目信息! puts("4.退出\n");//退出 puts("\n"); printf("選擇功能(1-4):[ ]\b\b"); scanf("%d",&n); if (n<1||n>4) { w2=1; getchar(); } else w2=0; } while (w2==1); switch(n) { case 1:ttzf();break; case 2:csxx();break; case 3:bsxm();break; case 4:exit(0);break; default:printf("未進行任何操作!"); }}void ttzf() //查看學校團體總分子函數{ fp2=fopen("zfen","r"); printf("\n各學校的團體總分情況如下:\n\n"); printf("學校 參賽項目 總分\n"); for(i=0; i<N; i++) { fread(&zf[i],sizeof(struct zongfen),1,fp2); printf("%-8s%s,%s,%-12s%-12d\n",zf[i].univ,zf[i].prog1,zf[i].prog2,zf[i].prog3,zf[i].total_score); } fclose(fp2); printf_back();}
void csxx() //查看參賽學校信息子函數{ fp3=fopen("xxiao","r"); printf("\n各參賽學校的情況如下:\n\n"); printf("學校 參賽項目 參賽者數\n"); for(i=0; i<N; i++) { fread(&xx[i],sizeof(struct xuexiao),1,fp3); printf("%-8s%-20s%-12d\n",xx[i].univ,xx[i].prog,xx[i].num_athlete); } fclose(fp3); printf_back();}
void bsxm() //查看比賽項目子函數{ fp4=fopen("pr","r"); printf("\n各比賽項目的信息如下:\n\n"); printf("項目 取分情況 賽者1 所屬學校 參賽者2 所屬學校\n"); for(i=0; i<N; i++) { fread(&pro[i],sizeof(struct program),1,fp4); printf("%-12s%-10d%-10s%-12s%-10s%-12s\n",pro[i].prog,pro[i].quming,pro[i].ath1,pro[i].univ1,pro[i].ath2,pro[i].univ2); } fclose(fp4); printf_back();}
void main(){ menu();}void menu(){ int n,w1; do { puts("歡迎進入運動會管理系統!\n"); puts("目錄\n"); puts("1.輸入信息\n"); puts("2.比賽結果錄入\n"); puts("3.查詢\n"); puts("4.退出\n"); puts("\n"); printf("選擇功能(1-4):[ ]\b\b"); scanf("%d",&n); if (n<1||n>4) { w1=1; getchar(); } else w1=0; } while (w1==1); switch(n) { case 1:Information();break; //輸入信息 case 2:savescore();break;//比賽結果錄入 case 3:Search();break;//查詢模塊 case 4:exit(0); }}
//公共函數void printf_back(){ int w; printf("\n\n\tSUCCESSFUL!\n\n"); printf("What do you want to do next?\n\n\t1).exit \t2).menu:[ ]\b\b"); scanf("%d",&w); if(w==1) exit(0); else menu();}
⑧ c語言編程:運動會管理系統
可以做,只是現在太忙,不能直接寫了。
⑨ 用C語言編寫個學院運動會管理系統
這個你就給20分,果斷不給你