主程序
#include "stdio.h"
#include "time.h"
#include "dos.h"
main()
{
int a;
while(1)
{
printf("1.dingshi;\n");
printf("2.shizhong.\n");
printf("please choice:");
scanf("%d",&a);
switch(a)
{
case 1:clrscr();dingshi();break;
case 2:clrscr();shizhong();break;
default:printf("please enter right number!!!\n"); getch(); break;
}
clrscr();
}
}
dingshi()
{
int a, timer;
printf("please enter time:(by minute,the big number is 546)");
scanf("%d",&a);
timer=a*60;
printf("It will work in %d seconds later",timer);
sleep(timer);
system("11.exe");
}
shizhong()
{
int h,m,s,A,B,timer=60;
time_t t;
struct tm *b;
printf("please enter hour:");
scanf("%d",&A);
printf("\nplease enter minute:");
scanf("%d",&B);
printf("\nthe program will work in %d:%d",A,B);
while(1)
{
time(&t);
b=localtime(&t);
h=b->tm_hour;
m=b->tm_min;
s=b->tm_sec;
if(h==A&&m==B)
system("11.exe");
sleep(timer);
}
}
分支程序
#include "conio.h"
#include "dos.h"
main()
{
int c;
textbackground(GREEN);
textcolor(RED);
gotoxy(12,12);
cprintf("It is the time to rest!!! Leave the computer now !!!\r\n");
while(1)
{
for(c=10000;c>0;c--)
{sound(c);
delay(1111);
}
nosound();
}
}
- 这是2010年时发布的代码
- 最早学会的语言就是C语言
- 还曾拿过学院竞赛第一