C语言用函数写课表 c语言课程设计怎么写
急急!!用C语言编课程表,要求:每星期5天,每天不超过6节课,有语文、数学、英语、政治、历史、音乐
#include stdio.h
创新互联是一家专业提供钦北企业网站建设,专注与成都网站建设、网站建设、H5技术、小程序制作等业务。10年已为钦北众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。
#include time.h
#include stdlib.h
#define DAYS_OF_A_WEEK 5
#define MAX_CLASSES_A_DAY 6
#define MAX_CLASS_NAME_LEN 10
#define TOTAL_CLASSESS_TYPE_NUM 5
typedef struct
{
char class_name[MAX_CLASS_NAME_LEN];
int class_num_per_week;
}Class;
Class class_data[]=
{
{"语文",3},{"数学",3},{"英语",3},{"政治",2},{"历史",2},{"音乐",2}
};
char week_days_name[][10] ={"星期天","星期一","星期二","星期三","星期四","星期五","星期六"};
char class_arrange_table[MAX_CLASSES_A_DAY][DAYS_OF_A_WEEK][MAX_CLASS_NAME_LEN]={0};
int main(int argc, char *argv[])
{
int i,j,k;
int row,col;
srand(time(NULL));
for(i=0;iTOTAL_CLASSESS_TYPE_NUM;i++)
{
for(j=0;jclass_data[i].class_num_per_week;j++)
{
row = rand()% DAYS_OF_A_WEEK ;
col = rand()% MAX_CLASSES_A_DAY;
while(strlen(class_arrange_table[row][col]) != 0)
{
row = rand()% DAYS_OF_A_WEEK ;
col = rand()% MAX_CLASSES_A_DAY;
}
strcpy(class_arrange_table[row][col],class_data[i].class_name);
}
}
printf("%4s","");
for(i=1;i=DAYS_OF_A_WEEK;i++)
{
printf("|%10s",week_days_name[i]);
}
printf("\n");
for(i=0;iMAX_CLASSES_A_DAY;i++)
{
for(j=0;j4+DAYS_OF_A_WEEK*10+DAYS_OF_A_WEEK;j++){ printf("-"); }
printf("\n");
printf("%4d",i+1);
for(j=0;jDAYS_OF_A_WEEK;j++)
{
printf("|%10s",class_arrange_table[i][j]);
}
printf("\n");
}
for(j=0;j4+DAYS_OF_A_WEEK*10+DAYS_OF_A_WEEK;j++){ printf("-"); }
printf("\n");
return 0;
}
用c语言如何编辑课程表,来个大神教教吧!最后做出来的课程表格式是exe格式,自己怎么也做不好。
写了一个,比较笨,不知行不行
生成exe程序在 Release 目录下
c语言怎样编写课程表,请问程序怎样写?
//2020年3月12日编写
#includestdio.h
char c=' ';
void chang()//长函数
{
printf("___________");
}
void kuang()//宽函数
{
printf("|");
}
void zon(char cc)//总汇函数
{
int a;
printf("\n");
printf("|");
for(a=0;a4;a++)
{
chang();
if(a3)
printf("%c",cc);
}
printf("|");
}
void zon2(char a1[],char a2[],char a3[],char a4[])//总汇函数2
{
printf("\n");
printf("|%-11s|",a1);printf("%-11s|",a2);printf("%-11s|",a3);printf("%-11s|",a4);
}//函数;
main()
{
int a,b;
for(a=0;a4;a++)//第一行
{
printf(" ");
chang();
}
printf("\n|%21c课程表%20c|",c,c);
zon(' ');
zon2(" ","1.2节","3.4节","5.6节");
zon('|');
zon2("星期一","语文","计算机","体育");//第二行
zon('|');
zon2("星期二","数学","政治","数学");//第三行
zon('|');
zon2("星期三","英语","体育","自习");//第四行
zon('|');
zon2("星期四","计算机","语文","体育");//第五行
zon('|');
zon2("星期五","计算机","英语","自习");//第六行
zon('|');
}
/*
printf(" ___________\n");// -=11;
printf("| 语 文 |\n");// |%2d字%3d字%2d|
printf("|___________|\n");// |%11d|
*/
急!!求C语言高手帮我做用C做一个课表
#includestdio.h
#includestring.h
#define NULL 0
void fu();
void shuru();
void ll();
void cx();
void xg();
void pf();
void quit();
int shumu=10;
struct student
{char name [10];
char sex;
int id;
float date[5];
int jieci[5];
int dao[5];
struct student *next;
}stu[10];
另外,团IDC网上有许多产品团购,便宜有口碑
C语言编一个课表查询
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
struct classlist
{
char time[12];
char kecheng[10];
classlist *next;
};
void main()
{
classlist *head=(classlist *)malloc(sizeof(classlist));
head-next=NULL;
for(int i=0;i3;i++)
{
classlist *s=(classlist *)malloc(sizeof(classlist));
s-next=head-next;
head-next=s;
if(i==0)
{
strcpy(s-time,"9:00-10:00");
strcpy(s-kecheng,"英语");
}
else if(i==1)
{
strcpy(s-time,"10:00-11:00");
strcpy(s-kecheng,"数学");
}
else if(i==2)
{
strcpy(s-time,"11:00-12:00");
strcpy(s-kecheng,"语文");
}
}
printf("请输入时间(格式: 9:00-10:00)");
char time1[12];
scanf("%s",time1);
while(head-next!=NULL)
{
if(strcmp(head-next-time,time1)==0)
{
printf("%s",head-next-kecheng);
break;
}
else
head=head-next;
}
}
本文名称:C语言用函数写课表 c语言课程设计怎么写
浏览地址:http://scyanting.com/article/doocjoh.html