大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
#includestdio.h
十年的天台网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。全网整合营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整天台建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“天台网站设计”,“天台网站推广”以来,每个客户项目都认真落实执行。
#includestring.h
int main()
{
void TestOnLineTeacherManage(); //声明教师信息管理函数
void TestOnLineSelfManage();//声明个人管理函数
int n;
printf(“0教师管理,1个人管理”);
scanf(“%d”,n);
If (n==0)
TestOnLineTeacherManage();
else
TestOnLineSelfManage();//选择教师管理或者个人信息管理
Return 0;
}
Void TestOnLineTeacherManage() //教师信息管理函数
{
Struct TestOnLineTeacher
{
Int Tnum;
Char Tname[20];
Char Tsex;
Char Ttel[20];
}Teacher[100]; //定义一个结构体
void add(); //定义教师信息添加
void del(); //定义教师信息删除
Void modify(); //定义教师信息修改
int a;
Printf(“1添加2删除3修改”);
Scanf (“%d”,a);
Switch(a)
{
Case1:add();break;
Case2:del();break;
Case3:modify();break;
Default:break;
}//选择功能
}
Void add() //教师信息添加函数,若添加Teacher[i]
{
printf(“输入工号”);
Scanf(“%d”,Teacher[i].Tnum);
printf(“输入姓名”);
Scanf(“%s”,Teacher[i].Tname);
printf(“输入性别f女m男”);
Scanf(“%c”,Teacher[i].Tsex);
printf(“输入电话”);
Scanf(“%s”,Teacher[i].Ttel);
}
Void del() //教师信息删除函数,若删除Teacher[i]
{
Teacher[i-1]=Teacher[i+1];
Free(Teacher[i]);
}
Void modify() //教师信息修改函数,若修改Teacher[i]
{
Int t;
Int num;
Char name[20];
Char sex;
Char tel[20];
Printf(“修改选项1工号2姓名3性别4电话”);
Scanf(“%d”,t);
Switch(t)
{
Case1:scanf(“%d”,num);Teacher[i].Tnum=num;break;
Case2:scanf(“%s”,name);strcpy(Teacher[i].Tname,name);break;
Case3:scanf(“%c”,sex);Teacher[i].Tsex=sex;break;
Case4:scanf(“%s”,tel);strcpy(Teacher[i].Ttel,tel);break;
Default:break;
}//选择修改项并修改
}
Void TestOnLineSelfManage() //个人信息管理
{
Struct TestOnLineManage
{
Int Mnum;
Char Mname[20];
Char Msex;
Char Mtel[20];
}Manage[1]; //定义一个结构体
Int b;
Int num;
Char name[20];
Char sex;
Char tel[20];
Printf(“修改选项1工号2姓名3性别4电话”);
Scanf(“%d”,b);
Switch(t)
{
Case1:scanf(“%d”,num);Manage[1].Mnum=num;break;
Case2:scanf(“%s”,name);strcpy(Manage[1].Mname,name);break;
Case3:scanf(“%c”,sex);Manage[1].Msex=sex;break;
Case4:scanf(“%s”,tel);strcpy(Manage[1].Mtel,tel);break;
Default:break;
}//选择修改项并修改
}
如果是要被使用者操作的系统, 使用pure C是比较麻烦的, 尤其是在视窗GUI处理上. (除非你要使用的是文字模式, 即便如此, 排版及页面控制也是件麻烦事).
我个人会建议使用VC, 简化GUI处理, 可将关注重心放在系统功能本身.
如果是课业或专题, 那就需要自行考量各部分的重要比率, 将某些部分进行简化, 加强重点的关注.
子表 ( MADE IN 127 ) ***/
/*** ! 在程序运行过程中不要切换窗口,否则,会出错 . ***/
#includegraphics.h
#includemath.h
#includetime.h
#define STEP 6.283183/60
#define PI 3.141592
#define X 307
#define Y 150 /*** 中心坐标 ***/
#define R 100
#define R_OUT (R+4) /*** 内外半径 ***/
#define R_S (R-20)
#define R_M (R-35)
#define R_H (R-50) /*** 各指针半径 ***/
#define MIN 60 /*** 设定延时 (分钟) ***/
#define C_I 9
int HH=0,MM=0;
main()
{
int gd=DETECT,gm,second,record_s,minite,record_m,hour,i,pc=60;
time_t t; float temp; char ch='#';
int int_M=MIN; pc=(MIN-int_M)*60;
initgraph (gd,gm,""); setbkcolor (0);
/*** 外观设计 ***/
circle (X,Y,R); setfillstyle (1,2); floodfill (X,Y,15);
circle (X,Y,R_OUT); setfillstyle (1,8); floodfill (X+R_OUT-1,Y,15);
rectangle (X-2,Y-R+8-4,X+2,Y-R+8+4);
rectangle (X-2,Y+R-8-4,X+2,Y+R-8+4);
rectangle (X-R+8-4,Y-2,X-R+8+4,Y+2);
rectangle (X+R-8-4,Y-2,X+R-8+4,Y+2);
for (i=1;i=60;i++)
if (i!=15i!=30i!=45i!=60)
if (i%5!=0) circle (X+(R-10)*cos(i*STEP),Y+(R-10)*sin(i*STEP),1);
else circle (X+(R-10)*cos(i*STEP),Y+(R-10)*sin(i*STEP),2);
rectangle (X+R_OUT,Y-6,X+R_OUT+6,Y+6);
setfillstyle (1,8); floodfill (X+R_OUT+3,Y,15);
temp=R_OUT*0.866;
line (X-R_OUT/2-5,Y-temp+2,X-R_OUT/2,Y-temp-30);
line (X-R_OUT/2+5,Y-temp-2,X-R_OUT/2+5,Y-temp-30);
line (X+R_OUT/2-5,Y-temp-2,X+R_OUT/2-5,Y-temp-30);
line (X+R_OUT/2+5,Y-temp+2,X+R_OUT/2,Y-temp-30);
line (X-R_OUT/2,Y-temp-30,X-R_OUT/2+5,Y-temp-30);
line (X+R_OUT/2-5,Y-temp-30,X+R_OUT/2,Y-temp-30);
line (X-R_OUT/2+5,Y-temp-25,X+R_OUT/2-5,Y-temp-25);
line (X-R_OUT/2+5,Y-temp-22,X+R_OUT/2-5,Y-temp-22);
floodfill (X-R_OUT/2-2,Y-temp,15);
floodfill (X+R_OUT/2+2,Y-temp,15);
floodfill (X,Y-R_OUT-10,15);
line (X-R_OUT/2-5,Y+temp-2,X-R_OUT/2,Y+temp+30);
line (X-R_OUT/2+5,Y+temp+2,X-R_OUT/2+5,Y+temp+30);
line (X+R_OUT/2-5,Y+temp+2,X+R_OUT/2-5,Y+temp+30);
line (X+R_OUT/2+5,Y+temp-2,X+R_OUT/2,Y+temp+30);
line (X-R_OUT/2,Y+temp+30,X-R_OUT/2+5,Y+temp+30);
line (X+R_OUT/2-5,Y+temp+30,X+R_OUT/2,Y+temp+30);
line (X-R_OUT/2+5,Y+temp+25,X+R_OUT/2-5,Y+temp+25);
line (X-R_OUT/2+5,Y+temp+22,X+R_OUT/2-5,Y+temp+22);
floodfill (X-R_OUT/2-2,Y+temp,15);
floodfill (X+R_OUT/2+2,Y+temp,15);
floodfill (X,Y+R_OUT+10,15);
for (i=1;i=MIN*60+1;i++) /*** 该循环严格一秒一次 ( 捕捉系统时间 ) ***/
{
setcolor (15);
circle (X,Y,5); circle (X,Y,2); setfillstyle (1,0); floodfill (X,Y,15);
settextstyle (2,0,0); setcolor (8); outtextxy (X-13,Y-52,"FIYTA");
outtextxy (X-30,Y+35,"MADE IN 127"); setcolor (2);
time (t); /*** 获取系统时间 ***/
hour=(ctime(t)[11]-'0')*10+(ctime(t)[12]-'0');
minite=(ctime(t)[14]-'0')*10+(ctime(t)[15]-'0');
second=(ctime(t)[17]-'0')*10+(ctime(t)[18]-'0');
if (ch==C_I)
hour=(hour+HH)%24; minite=(minite+MM)%60;
window (22,22,80,22); printf (" The current time is ");
if (hour10) printf ("0"); printf ("%d : ",hour);
if (minite10) printf ("0"); printf ("%d : ",minite);
if (second10) printf ("0"); printf ("%d",second);
window (35,20,80,20);
printf (" "); if (int_M10) printf ("0"); printf ("%d : ",int_M);
if (pc10) printf ("0"); printf ("%d ",pc);
record_m=minite;
hour=10*hour+minite/6-30;
minite=2*minite+second/30-30;
second-=15; record_s=second;
setcolor (0); /*** 写指针 ***/
line (X+7*cos(PI+hour*STEP/2),Y+7*sin(PI+hour*STEP/2),X+R_H*cos(hour*STEP/2),Y+R_H*sin(hour*STEP/2));
setcolor (1);
line (X+13*cos(PI+minite*STEP/2),Y+13*sin(PI+minite*STEP/2),X+R_M*cos(minite*STEP/2),Y+R_M*sin(minite*STEP/2));
setcolor (4);
line (X+20*cos(PI+second*STEP),Y+20*sin(PI+second*STEP),X+R_S*cos(second*STEP),Y+R_S*sin(second*STEP)); record_s=second;
ch='#';
while (second==record_s) /*** 此循环用来 " 监视 " 系统秒针的变化 ***/
{
time (t); second=(ctime(t)[17]-'0')*10+(ctime(t)[18]-'0')-15;
if (bioskey(1)(ch=getch())==C_I||ch==27)
{
if (ch==27)
window (22,22,80,22); printf (" PLS enter the time : ");
window (48,22,80,22);
while (!bioskey(1))
scanf ("%d:%d:%d",HH,MM);
if (HH=23HH=0MM=0MM=59) break; else
}
}
setcolor (2); /*** 覆盖指针 ( 由秒控制 ) ***/
if ((record_m*60+60+second+15)%360==0||ch==C_I)
line (X+7*cos(PI+hour*STEP/2),Y+7*sin(PI+hour*STEP/2),X+R_H*cos(hour*STEP/2),Y+R_H*sin(hour*STEP/2));
if ((second+15)%30==0||ch==C_I)
line (X+13*cos(PI+minite*STEP/2),Y+13*sin(PI+minite*STEP/2),X+R_M*cos(minite*STEP/2),Y+R_M*sin(minite*STEP/2));
if (i!=60*MIN+1||ch==C_I)
line (X+20*cos(PI+record_s*STEP),Y+20*sin(PI+record_s*STEP),X+R_S*cos(record_s*STEP),Y+R_S*sin(record_s*STEP));
if (pc==0int_M!=0) pc=60; pc--; if (pc==59) int_M--;
}
window (20,22,80,22);
printf (" The watch time out! Press any key ... "); getch ();
closegraph ();
}