1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| #include <stdio.h>
#include <conio.h>
#include <dos.h>
int main(void){
int rep;
clrscr();
struct dostime_t t;
do{
printf("DONNER La ville\n");
printf("[1]...Paris,Madrid,Bruxelles,Copenhague.\n");
printf("[2]...Athene,Istanbul,Minsk,Bucarest,le caire.\n");
printf("[3]...Baghdad,Koweit,Ryad,Nairobi.\n");
printf("[4]...pékin,chongqing,hong kong,Urumqi.\n");
printf("[5]...Heur Atlantique Canada.\n");
scanf("%d",&rep);
}
while(rep>5||rep<1);
switch(rep){
case 1:
_dos_gettime(&t);
printf("@$The current time is: %2d:%02d:%02d.%02d\n", t.hour, t.minute,
t.second, t.hsecond);
break;
case 2:
_dos_gettime(&t);
t.hour++;
printf("@$The current time is: %2d:%02d:%02d.%02d\n", t.hour, t.minute,
t.second, t.hsecond);
break;
case 3:
_dos_gettime(&t);
t.hour=t.hour+2;
printf("@$The current time is: %2d:%02d:%02d.%02d\n", t.hour, t.minute,
t.second, t.hsecond);
break;
case 4:
_dos_gettime(&t);
t.hour=t.hour+7;
printf("@$The current time is: %2d:%02d:%02d.%02d\n", t.hour, t.minute,
t.second, t.hsecond);
break;
case 5:
_dos_gettime(&t);
t.hour=t.hour-4;
printf("@$The current time is: %2d:%02d:%02d.%02d\n", t.hour, t.minute,
t.second, t.hsecond);
break;
}
getch();
return 0;
} |