C语言课程设计之抽奖系统

本文实例为大家分享了C语言课程设计之抽奖系统的具体代码,供大家参考,具体内容如下

该程序的功能包括:

1、设置中奖人员
2、设置内幕人员
3、添加功能
4、删除功能
5、颜色设置
6、开发人员介绍

在使用该系统之前,请先在你程序保存的位置建一个17计科2.txt文档,里面填上学号和姓名,例如:25 贺志营。

建好txt文档后就可以直接运行了

运行截图及代码如下:

主界面:

功能介绍界面:

设置奖项界面:

开始抽奖界面不好演示,它是个动态的,下面有代码,可以自己运行下

程序代码:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#include<time.h>
#include <windows.h>
//#pragma comment(lib, "winmm.lib")

struct data{
 char id[20];
 char name[20];
};

struct data information[110];//普通人员信息
struct data information0[110];//滚动人员信息
struct data prize[110];//总获奖人员信息
struct data winner1[110],winner2[110],winner3[110];//内幕人员信息

int grade1=0,grade2=0,grade3=0;//内幕一等奖、二等奖、三等奖的人数
int ms=60;//初始滚动时间间隔
int count=0;//滚动人员总数
int people=0;//普通人员总数
int people1=0,people2=0,people3=0;//普通一等奖、二等奖、三等奖的人数
char strid[20];

void Function_introduction();//功能介绍
void Print_menu();//打印菜单
void Set_award();//设置奖项
void Read_information();//从文件中读取信息,放到普通人员信息中
void Read_information0();//从文件中读取信息,放到滚动人员信息中
void Roll_information0();//滚动信息,该信息是滚动人员的信息

void Set_speed();//设置滚动时间间隔
void Set_colour();//颜色设置
void Set_grade();//设置必中奖等级
void Set_winner1();//设置一等奖信息
void Set_winner2();//设置二等奖信息
void Set_winner3();//设置三等奖信息
void Set_awards();//设置奖项人数

void Delet_function();//删除功能
void Delet_number();//按学号删除
void Delet_name();//按姓名删除
void Delet_information();//删除普通人员的信息
void Delet_information0();//删除内幕人员信息
void Add_function();//添加功能
void Begin_luck();//开始抽奖
void Roll_speed(int ms);//滚动速度
void Developer();//开发人员介绍

int main()
{

 Read_information();
 Read_information0();
 system("color 07");
 Print_menu();

 return 0;
}

void Function_introduction()//功能介绍
{
 system("cls");
 printf("\n\t\t  <-抽奖系统功能介绍->\n\n");
 printf("\t\t\t1、设置中奖人员\n");
 printf("\t\t\t2、设置内幕人员\n");
 printf("\t\t\t3、添加功能\n");
 printf("\t\t\t4、删除功能\n");
 printf("\t\t\t5、颜色设置\n");
 printf("\t\t\t6、开发人员介绍\n");
 printf("\t\t\t按任意键返回");
 getch();

}

void Print_menu()//打印菜单
{
 int choose;
 while(1)
 {
 system("cls");
 printf("\n\n");
 printf("\t*********************************************************\n");

 printf("\t*\t  <-欢迎来到抽奖系统->\t\t\t*\n");
 printf("\t*\t\t\t\t\t\t\t*\n");

 printf("\t*\t\t开始抽奖请按1\t\t\t\t*\n");
 printf("\t*\t\t设置奖项请按2\t\t\t\t*\n");
 printf("\t*\t\t滚动设置请按3\t\t\t\t*\n");
 printf("\t*\t\t颜色设置请按4\t\t\t\t*\n");
 printf("\t*\t\t添加功能请按5\t\t\t\t*\n");
 printf("\t*\t\t删除功能请按6\t\t\t\t*\n");
 printf("\t*\t\t人员介绍请按7\t\t\t\t*\n");
 printf("\t*\t\t功能介绍请按8\t\t\t\t*\n");
 printf("\t*\t\t结束程序请按0\t\t\t\t*\n");
 printf("\t*\t\t\t\t\t\t\t*\n");
 printf("\t*********************************************************\n");

 printf("\n\n\t\t\t请输入选项:");
 scanf("%d",&choose);

 switch(choose)
 {
 case 0:
 return;
 case 1:
 Begin_luck();//开始抽奖
 break;
 case 2:
 Set_award();//设置奖项
 break;
 case 3:
 Set_speed();//设置滚动时间间隔
 break;
 case 4:
 Set_colour();//颜色设置
 break;
 case 5:
 Add_function();//添加功能
  break;
 case 6:
 Delet_function();//删除功能
 break;
 case 7:
 Developer();//开发人员介绍
 break;
 case 8:
 Function_introduction();//功能介绍
 break;
 }
 }
}

void Set_award()//设置奖项
{
 int choose;
 while(1)
 {
 system("cls");
 printf("\n\n");
 printf("\t*********************************************************\n");
 printf("\t*\t\t\t\t\t\t\t*\n");
 printf("\t*\t\t设置奖项人数请按1\t\t\t*\n");
 printf("\t*\t\t设置内幕人员请按2\t\t\t*\n");
 printf("\t*\t\t返回上一层请按0\t\t\t\t*\n");
 printf("\t*\t\t\t\t\t\t\t*\n");
 printf("\t*********************************************************\n");

 printf("\n\n\t\t\t请输入选项:");
 scanf("%d",&choose);
 switch(choose)
 {
 case 0:
 return;
 case 1:
 Set_awards();//设置奖项人数

 break;
 case 2:
 Set_grade();//设置内幕人员
 break;
 }
 }
}

void Set_colour()//颜色设置
{
 char choose[20];
 int i;
 system("cls");
 printf("\n\n\t0 = 黑色  8 = 灰色\n");
 printf("\t1 = 蓝色  9 = 淡蓝色\n");
 printf("\t2 = 绿色  A = 淡绿色\n");
 printf("\t3 = 浅绿色  B = 淡浅绿色\n");
 printf("\t4 = 红色  C = 淡红色\n");
 printf("\t5 = 紫色  D = 淡紫色\n");
 printf("\t6 = 黄色  E = 淡黄色\n");
 printf("\t7 = 白色  F = 亮白色\n\n");
 printf("\t请输入字体颜色对应的代码:");
 scanf("%s",choose);
 if(strcmp(choose,"0")==0)
 system("color 00");
 else if(strcmp(choose,"1")==0)
 system("color 01");
 else if(strcmp(choose,"2")==0)
 system("color 02");
 else if(strcmp(choose,"3")==0)
 system("color 03");
 else if(strcmp(choose,"4")==0)
 system("color 04");
 else if(strcmp(choose,"5")==0)
 system("color 05");
 else if(strcmp(choose,"6")==0)
 system("color 06");
 else if(strcmp(choose,"7")==0)
 system("color 07");
 else if(strcmp(choose,"8")==0)
 system("color 08");
 else if(strcmp(choose,"9")==0)
 system("color 09");
 else if(strcmp(choose,"A")==0)
 system("color 0A");
 else if(strcmp(choose,"B")==0)
 system("color 0B");
 else if(strcmp(choose,"C")==0)
 system("color 0C");
 else if(strcmp(choose,"D")==0)
 system("color 0D");
 else if(strcmp(choose,"E")==0)
 system("color 0E");
 else if(strcmp(choose,"F")==0)
 system("color 0F");
 else
 {
 printf("输入错误按任意键返回上一层\n");
 getch();
 return;
 }
 printf("\t设置完毕按任意键返回");
 getch();

}

void Delet_function()//删除功能
{
 int choose;
 while(1)
 {
 system("cls");
 printf("\n\n");
 printf("\t*********************************************************\n");
 printf("\t*\t\t\t\t\t\t\t*\n");
 printf("\t*\t\t按姓名删除请按1\t\t\t\t*\n");
 printf("\t*\t\t按学号删除请按2\t\t\t\t*\n");
 printf("\t*\t\t返回上一层请按0\t\t\t\t*\n");
 printf("\t*\t\t\t\t\t\t\t*\n");
 printf("\t*********************************************************\n");

 printf("\n\n\t\t\t请输入选项:");
 scanf("%d",&choose);
 switch(choose)
 {
 case 0:
 return;
 case 1:
 Delet_name();//按姓名删除
 break;
 case 2:
 Delet_number();//按学号删除
 break;
 }
 }
}

void Read_information()//从文件中读取信息
{
 FILE *fp=fopen("17计科2.txt","r");
 while(!feof(fp))
 {
 //存储该信息到普通人员信息中,便于设置内幕人员
 fscanf(fp,"%s%s",information[people].id,information[people].name);
 people++;
 }
 fclose(fp);
}

void Read_information0()//读取滚动人员的信息
{
 FILE *fp=fopen("17计科2.txt","r");
 while(!feof(fp))
 {
 //存储信息到滚动人员信息中,用于滚动时打印在显示屏幕中
 fscanf(fp,"%s%s",information0[count].id,information0[count].name);
 count++;
 }
 fclose(fp);
}

void Roll_information0()//滚动信息,该信息是滚动人员的信息
{
 int i=0;
 system("cls");
 printf("按任意键开始抽奖,按任意键停止抽奖\n");
 getch();
// PlaySound (TEXT("C:中国人民解放军军乐团-国际歌.wav"), NULL, SND_ASYNC | SND_NODEFAULT);
 while(1)
 {
 system("cls");
 if(kbhit()!=0)
 break;
 i=rand()%count;
 printf("%s",information0[i].name);//显示滚动信息
 //i++;
 //if(i==count)
 //i=0;
 Roll_speed(ms);
 }
// PlaySound (0, NULL, SND_ASYNC | SND_NODEFAULT);
}

void Begin_luck()//开始抽奖
{
 int i,j,choose,t;
 system("cls");
 if(grade3==0&&grade2==0&&grade3==0&&people1==0&&people2==0&&people3==0)
 {

 printf("请先设置奖项人数按任意键返回\n");
 getch();
 return;
 }
 printf("下面开始抽取三等奖人员,按任意键继续\n");
 getch();
 j=0;//代表各奖项人员的总数包括内幕人员
 while(grade3--)//内幕三等奖人员
 {
 if(grade3<0)
 break;
 Roll_information0();
 printf("%s",winner3[grade3].name);
 prize[j++]=winner3[grade3];
 strcpy(strid,winner3[grade3].id);
 Delet_information0();//删除该成员在滚动信息中的信息
 getch();
 getch();
 }
 while(people3--)//普通三等奖人员
 {
 if(people3<0)
 break;
 Roll_information0();
 srand((unsigned)time(0));
 t=rand()%people;
 printf("%s",information[t].name);
 prize[j++]=information[t];

 strcpy(strid,information[t].id);
 Delet_information();//删除该成员在普通信息中的信息
 Delet_information0();//删除该成员在滚动信息中的信息
 //printf("\n\n\n");
 //for(i=0;i<count;i++)
 //printf("%s ",information0[i].name);
 getch();
 getch();
 }
 system("cls");
 printf("以下是三等奖名单,按任意键继续\n");
 for(i=0;i<j;i++)
 printf("%s\n",prize[i].name);
 getch();

 system("cls");
 printf("下面开始抽取二等奖人员,按任意键继续\n");
 getch();
 j=0;
 while(grade2--)
 {
 if(grade2<0)
 break;
 Roll_information0();//显示滚动人员信息
 printf("%s",winner2[grade2].name);
 prize[j++]=winner2[grade2];
 strcpy(strid,winner2[grade2].id);
 Delet_information0();//删除该成员在滚动信息中的信息
 getch();
 getch();
 }

 while(people2--)
 {
 if(people2<0)
 break;
 Roll_information0();
 srand((unsigned)time(0));
 t=rand()%people;
 printf("%s",information[t].name);
 prize[j++]=information[t];
 strcpy(strid,information[t].id);
 Delet_information();//删除该成员在普通信息中的信息
 Delet_information0();//删除该成员在滚动信息中的信息
 getch();
 getch();
 }
 system("cls");
 printf("以下是二等奖名单,按任意键继续\n");
 for(i=0;i<j;i++)
 printf("%s\n",prize[i].name);
 getch();

 system("cls");
 printf("下面开始抽取一等奖人员,按任意键继续\n");
 getch();
 j=0;
 while(grade1--)//内幕一等奖人员
 {
 if(grade1<0)
 break;
 Roll_information0();
 printf("%s",winner1[grade1].name);
 prize[j++]=winner1[grade1];
 strcpy(strid,winner1[grade1].id);
 Delet_information0();//删除该成员在滚动信息中的信息
 getch();
 getch();
 }
 while(people1--)
 {
 if(people1<0)
 break;
 Roll_information0();
 srand((unsigned)time(0));
 t=rand()%people;
 printf("%s",information[t].name);
 prize[j++]=information[t];

 strcpy(strid,information[t].id);
 Delet_information();//删除该成员在普通信息中的信息
 Delet_information0();//删除该成员在滚动信息中的信息
 getch();
 getch();
 }
 system("cls");
 printf("以下是一等奖名单,按任意键继续\n");
 for(i=0;i<j;i++)
 printf("%s\n",prize[i].name);

 printf("抽奖完毕按任意键返回\n");
 getch();
}

void Set_speed()//滚动速度
{
 char choose[20];
 int i,t=0;
 system("cls");
 printf("请输入滚动时间间隔\n");
 scanf("%s",choose);
 for(i=0;choose[i]!='\0';i++)
 if(choose[i]<'0'||choose[i]>'9')
 {
 printf("输入有误按任意键返回");
 getch();
 return;
 }
 else
 t=10*t+choose[i]-'0';
 ms=t;
 printf("设置完毕按任意键返回\n");
 getch();
}

void Roll_speed(int ms)
{
 clock_t t1,t2;
 t1=clock();
 while(1)
 {
 t2=clock();
 if(t2-t1>=ms)
 return;
 }
}

void Set_awards()//设置奖项人数
{
 int choose,t;
 while(1)
 {
 system("cls");
 printf("请输入三等奖人数(正整数):\n");
 scanf("%d",&t);
 if(t<0||t>count)
 {
 printf("输入不合法,请输入1到%d之内的数字",count);
 getch();
 }
 else
 {
 people3+=t;
 break;
 }

 }
 while(1)
 {
 system("cls");
 printf("请输入二等奖人数:\n");
 scanf("%d",&t);
 if(t<1||t>count)
 {
 printf("输入不合法,请输入1到%d之内的数字",count);
 getch();

 }
 else
 {
 people2+=t;
 break;
 }

 }
 while(1)
 {
 system("cls");
 printf("请输入一等奖人数:\n");
 scanf("%d",&t);
 if(t<0||t>count)
 {
 printf("输入不合法,请输入1到%d之内的数字",count);
 getch();
 }
 else
 {
 people1+=t;
 break;
 }
 }
 printf("设置完毕按任意键返回\n");
 getch();
 return;
}

void Set_grade()//设置内幕中奖等级
{
 char grade[20];
 system("cls");
 printf("请输入中奖等级,返回上一层请按0\n");
 scanf("%s",grade);
 if(strcmp(grade,"0")==0)
 return;

 else if(strcmp(grade,"1")==0)
 Set_winner1();
 else if(strcmp(grade,"2")==0)
 Set_winner2();
 else if(strcmp(grade,"3")==0)
 Set_winner3();
 else
 {
 printf("请输入1到3等级按任意键返回\n");
 getch();
 return;
 }
}

void Set_winner1()//设置内幕一等奖信息
{
 int i,j;
 system("cls");
 printf("请输入必中奖人员学号和姓名:\n");
 scanf("%s%s",winner1[grade1].id,winner1[grade1].name);
 for(i=0;i<count;i++)
 if(strcmp(winner1[grade1].id,information0[i].id)==0)
 break;
 for(j=0;j<count;j++)
 if(strcmp(winner1[grade1].name,information0[i].name)==0)
 break;
 if(i==count||j==count)
 {
 printf("抽奖名单中无此信息按任意键返回");
 getch();
 return;

 }
 printf("设置成功按任意键继续");
 getch();
 strcpy(strid,winner1[grade1].id);
 Delet_information();//普通总成员减1
 grade1++;//内幕一等奖成员加1
 people1--;//普通一等奖成员减1
 return;
}

void Set_winner2()//设置内幕二等奖信息
{
 int i,j;
 system("cls");
 printf("请输入必中奖人员学号和姓名:\n");
 scanf("%s%s",winner2[grade2].id,winner2[grade2].name);
 for(i=0;i<count;i++)
 if(strcmp(winner2[grade2].id,information0[i].id)==0)
 break;
 for(j=0;j<count;j++)
 if(strcmp(winner2[grade2].name,information0[i].name)==0)
 break;
 if(i==count||j==count)
 {
 printf("抽奖名单中无此信息按任意键返回");
 getch();
 return;
 }
 printf("设置成功按任意键继续");
 getch();
 strcpy(strid,winner2[grade2].id);
 Delet_information();//普通总人员减1
 grade2++;//内幕二等奖人员加1
 people2--;//普通二等奖人员减1
 return;
}

void Set_winner3()//设置内幕三等奖信息
{
 int i,j;
 system("cls");
 printf("请输入必中奖人员学号和姓名:\n");
 scanf("%s%s",winner3[grade3].id,winner3[grade3].name);
 for(i=0;i<count;i++)
 if(strcmp(winner3[grade3].id,information0[i].id)==0)
 break;
 for(j=0;j<count;j++)
 if(strcmp(winner3[grade3].name,information0[i].name)==0)
 break;
 if(i==count||j==count)
 {
 printf("抽奖名单中无此信息按任意键返回");
 getch();
 return;
 }
 printf("设置成功按任意键继续");
 getch();
 strcpy(strid,winner3[grade3].id);
 Delet_information();//普通总人员减1
 grade3++;//内幕三等奖人员加1
 people3--;//普通三等奖人员减1
 return;
}

void Delet_number()//按学号删除
{
 int i;
 system("cls");
 while(1)
 {

 printf("请输入要删除人的学号\n");
 scanf("%s",strid);
 for(i=0;i<count;i++)
 if(strcmp(strid,information[i].id)==0)
 break;
 if(i==count)
 {
 printf("未找到该学号,请重新输入\n");
 getch();
 return;
 }
 else
 break;
 }
 Delet_information();
 Delet_information0();
 printf("删除成功按任意键返回上一层\n");
 getch();
}

void Delet_name()//按姓名删除
{
 int i;

 while(1)
 {
 system("cls");
 printf("请输入要删除人的姓名\n");
 scanf("%s",&strid);
 for(i=0;i<count;i++)
 if(strcmp(strid,information0[i].name)==0)
 {
 strcpy(strid,information0[i].id);
 break;
 }
 if(i==count)
 {
 printf("未找到该人员按任意键返回上一层\n");
 getch();
 return;
 }
 else
 break;
 }

 Delet_information();
 Delet_information0();
 printf("删除成功按任意键返回上一层\n");
 getch();
}

void Delet_information()//删除该学号人员在普通人员中的信息
{
 int i,j;
 for(i=0;i<people;i++)
 if(strcmp(information[i].id,strid)==0)
 {
 people--;
 for(j=i;j<people;j++)
 information[j]=information[j+1];
 return;
 }
}

void Delet_information0()//删除该成员在滚动信息中的信息
{
 int i,j;
 //printf("\n\n*********%s\n\n",strid);
 for(i=0;i<count;i++)
 if(strcmp(information0[i].id,strid)==0)
 {
 count--;
 //printf("\n\n*********%s\n\n",information0[i].name);
 for(j=i;j<count;j++)
 information0[j]=information0[j+1];
 return;
 }
}
void Add_function()//添加功能
{
 int i;
 system("cls");
 char id[20],name[20];
 printf("请输入添加人员的学号和姓名\n");
 scanf("%s%s",&id,&name);
 for(i=0;i<count;i++)
 if(strcmp(information0[i].id,id)==0)
 {
 printf("该学号已存在按任意键返回");
 getch();
 return;
 }
 for(i=0;i<count;i++)
 if(strcmp(information0[i].name,name)==0)
 {
 printf("该姓名已存在按任意键返回");
 getch();
 return;
 }
 strcpy(information0[count].id,id);
 strcpy(information0[count].name,name);
 information[people]=information0[count];
 count++;
 people++;
 printf("添加成功,按任意键返回");
 getch();
}

void Developer()
{

 system("cls");
 printf("\n\n\t\t\t组长:贺志营");
 printf("\n\n\t\t\t组员:刘欣鹏");
 printf("\n\n\t\t\t组员:卢开伟");
 printf("\n\n\t\t  按任意键返回上一层");
 getch();

}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • 学生成绩管理系统C语言代码实现

    C语言实现了学生成绩管理系统,可以进行学生成绩的增加,删除,更新,查询,计算和展示. 完整代码如下: #include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct person //定义结构体 { char num[10]; //学号 char name[20]; //姓名 float cyuyan; //C语言成绩 float en; //物理学成绩 float ji; //原子物理成绩

  • C语言编写学生成绩管理系统

    用C语言编写学生成绩管理系统代码,供大家参考,具体内容如下 C语言实现学生成绩管理系统实战教学 https://www.jb51.net/article/154767.htm (1)给出所选课程设计题目以及本题目具体所要完成的功能要求说明. 1.课程设计题目:学生成绩管理系统 2.完成的功能要求: (1).主要实现的功能: 1---学生输入 2---学生插入 3---学生查询(按学号) 4---学生删除 5---学生输出 6---计算每名学生的平均分并输出 7---计算每科的平均分并输出 8--

  • C语言通讯录管理系统完整版

    C语言实现了通讯录的录入信息.保存信息.插入.删除.排序.查找.单个显示等功能.. 完整的代码如下: #include <stdio.h> #include <malloc.h> //得到指向大小为Size的内存区域的首字节的指针// #include <string.h> #include <stdlib.h> //标准库函数// #define NULL 0 #define LEN sizeof(struct address_list) //计算字节//

  • C语言学生成绩管理系统源代码

    大学C语言实训课,C语言学生成绩管理系统,供大家参考,具体内容如下 #include<stdio.h> #include<string.h> #include<math.h> struct student { int num; char name[20]; float pingshi; float shiyan; float kaoshi; double zongping; }stu[4]; void main() { void a(); void b(); void

  • C语言学生管理系统源码分享

    本文实例为大家分享了C语言学生管理系统源码,供大家参考,具体内容如下 #include<stdio.h> #include<stdlib.h> //结构体可以存放的学生信息最大个数,不可变变量 int const MAX_LENGTH=100; //学生信息结构体数组,最多可以存放100个学生信息 struct student{ int id; //学号 char *name; //姓名 int age; //年龄 float c_score; //C语言成绩 float engl

  • C语言职工信息管理系统源码

    本文实例为大家分享了C语言职工信息管理系统的具体代码,供大家参考,具体内容如下 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> struct worker { char ID[20];//工号 char name[20];//姓名 char sex[5];//性别 char born[20];//生日 char edu[20];//学历 char po

  • 学生信息管理系统C语言版

    C语言学生信息管理系统包括以下功能: 1.学生信息的整体注册 2.学生信息的修改 3.学生成绩信息的录入 4.学生信息的添加 5.恢复误删的学生信息 6.学生信息的删除 7.密码修改保存函数 8.学生信息的查询 9.密码修改函数 10.学生信息管理系统的菜单函数 #include "stdio.h" #include "malloc.h" #include "string.h" #include "stdlib.h" #inc

  • C语言利用结构体数组实现学生成绩管理系统

    要求: 某班有最多不超过30人(具体人数由键盘输入)参加期末考试,最多不超过6门(具体门数由键盘输入).定义结构体类型描述学生信息,每个学生信息包括:学号.姓名.多门课的成绩.总成绩和平均成绩.用结构体数组作为函数参数,编程实现如下菜单驱动的学生成绩管理系统. (1) 录入每个学生的学号.姓名和各科考试成绩. (2) 计算每门课程的总分和平均分. (3) 计算每个学生的总分和平均分. (4) 按每个学生的总分由高到低排出名次表. (5) 按学号由小到大排出成绩表. (6) 按姓名的字典顺序排出成

  • C语言图书管理系统简洁版

    DOS界面的图书管理系统,具体内容如下 程序分为两块:管理员操作(收录图书.删除图书等)和会员操作(注册.借书.还书等): 1.管理员操作界面 2.会员操作界面 global.h头文件:(程序中只使用了一个编写的头文件,在这里存放了所有的接口函数以及需要使用到的头文件,还有结构体的定义) #include "iostream" #include "string" #include "fstream" #include "conio.h&

  • C语言课程设计之抽奖系统

    本文实例为大家分享了C语言课程设计之抽奖系统的具体代码,供大家参考,具体内容如下 该程序的功能包括: 1.设置中奖人员 2.设置内幕人员 3.添加功能 4.删除功能 5.颜色设置 6.开发人员介绍 在使用该系统之前,请先在你程序保存的位置建一个17计科2.txt文档,里面填上学号和姓名,例如:25 贺志营. 建好txt文档后就可以直接运行了 运行截图及代码如下: 主界面: 功能介绍界面: 设置奖项界面: 开始抽奖界面不好演示,它是个动态的,下面有代码,可以自己运行下 程序代码: #include

  • C语言课程设计之停车场管理问题

    C语言课程设计之停车场管理问题,供大家参考,具体内容如下 1.问题描述 停车场内只有一个可停放n辆汽车的狭长通道,且只有一个大门可供汽车进出.汽车在停车场内按车辆到达时间的先后顺序,依次由北向南排列(大门在最南端,最先到达的第一辆车停放在停车场的最北端),若车场内已停满n辆汽车,则后来的汽车只能在门外的便道上等候,一旦有车开走,则排在便道上的第一辆车即可开入:当停车场内某辆车要离开时,在它之后开入的车辆必须先退出车场为它让路,待该辆车开出大门外,其它车辆再按原次序进入车场,每辆停放在车场的车在它

  • C语言实现简单的抽奖系统

    本文实例为大家分享了C语言实现简单的抽奖系统的具体代码,供大家参考,具体内容如下 效果图 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<conio.h> #include<time.h> #include <windows.h>   struct data{     char id[20];     char name[20]; };   int t1

  • C语言实现学生学籍管理系统课程设计

    目录 设计要求 完整代码 运行结果 本文实例为大家分享了C语言实现学生学籍管理系统的具体代码,供大家参考,具体内容如下 设计要求 设计学籍管理系统 1.添加学生信息2.浏览学生信息3.查询学生信息4.修改学生信息5.册J除学生信息6.排序学生信息7.读取文件学生8.保存到文件 完整代码 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> #include<math.h> #includ

  • C语言图书管理系统课程设计

    这是本人大一第二学期初C语言课程设计的作品,嘿嘿,本来以为已经找不到原稿了,今天无意中竟然在QQ网络硬盘中找到了当初的teta版,发布于此,以作纪念. C 源代码如下: #include<stdio.h> #include<stdlib.h> #include<string.h> struct book{ char book_name[30]; int bianhao; double price; char author[20]; char state[20]; cha

  • C语言实现电话簿管理系统课程设计

    本文实例为大家分享了C语言课程设计:电话簿管理系统,供大家参考,具体内容如下 文件目录: 初始界面 现在显示一部分代码: //添加联系人 void add() { int i; FILE *fp1;//定义文件指针fp1,使其指向电话簿文本文件 fp1=fopen("电话簿.txt","a+"); printf("请输入要增加的联系人的个数:"); scanf("%d",&n); for(i=num;i<num+

  • C语言实践设计开发飞机游戏

    目录 一.前言 二.从设计初始菜单界面开始 三.游戏操作指南——guide函数 四.游戏的主体gamebody() ①简化通用的游戏框架 ②头文件一览 ③清屏函数的实现 ④光标隐藏函数 ⑤Initgame函数 ⑥show函数的实现 ⑦与用户输入有关的更新- updateWithinput ⑧与用户输入无关的更新-updateWithoutinput ⑨组合而成的gamebody函数 ⑩不足与展望 一.前言 [设计难度 : ★☆☆☆☆ [参考书籍:<C语言课程设计与游戏开发实践教程> [主要涉及

  • java实现连连看游戏课程设计

    本文为大家分享了JAVA语言课程设计:连连看小游戏,供大家参考,具体内容如下 1.设计内容 界面中有5*10的界面,图中共有6种不同的图片,每两个相同的图片连接在一起,如果连线中转折的次数<=3次,两张图片可同时削掉,否则不能削去. 2.设计要求 色彩鲜艳,鼠标点击键好用,以固定时间将所有图片消掉为胜利,若时间到了,图片还有,则闯关失败. 3.设计思想 1)    搭建界面,首先搭建简单界面,可以先用按钮代替图片,并且行列可以先少做一些,如下图所示:2)    每次用户选择两个图形,如果图形满足

  • C语言实现航空订票系统课程设计

    本文实例为大家分享了C语言实现航空订票系统的具体代码,供大家参考,具体内容如下 大一写的时候没有写注释,后来也懒得加了.在这里说一下读写文件的思路吧. 就是利用二进制将一整个结构体中的数据存入文件,然后读取文件时再用二进制的形式将结构体中的数据读取出来,边读取边创建链表,将结构体中的数据保存到链表中. 以下代码可直接复制粘贴就能运行,绝对是新手的好福利! 如果有第一次写这种大作业不知道如何下手,但又不想直接复制粘贴,想搞清楚这个代码的原理的可以私信我,毕竟我当时也第一次写这种大作业时也很苦恼(我

  • C语言银行系统课程设计

    本文为大家分享了C语言银行系统课程设计,供大家参考,具体内容如下 main.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> #include <windows.h> #define MaxNum 200 #define N_P 6 typedef struct { int AccountNumber[3]; char name[20];

随机推荐