win98se

ProgrammingGo - dlgclk.cpp

Nov 21st, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4. #include <conio.h>
  5. #include <graphics.h>
  6.  
  7. void main()
  8. {
  9.     clrscr();
  10.     struct time t;
  11.     char hr[5], min[5], sec[5];
  12.     int gd=DETECT, gm;
  13.     initgraph(&gd, &gm, "c:\tc\bgi");
  14.     while(1)
  15.     {
  16.         gettime(&t);
  17.         if(kbhit())
  18.             break;
  19.         itoa(t.ti_hour,hr,10);
  20.         itoa(t.ti_min,min,10);
  21.         itoa(t.ti_sec,sec,10);
  22.         setcolor(CYAN);
  23.         settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 11);
  24.         outtextxy(60, 150, hr);
  25.         setcolor(RED);
  26.         settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 11);
  27.         outtextxy(215, 135, ":");
  28.         setcolor(LIGHTGREEN);
  29.         settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 11);
  30.         outtextxy(230, 150, min);
  31.         setcolor(WHITE);
  32.         settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 11);
  33.         outtextxy(390, 135, ":");
  34.         setcolor(LIGHTBLUE);
  35.         settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 11);
  36.         outtextxy(405, 150, sec);
  37.         sleep(1);
  38.         cleardevice();
  39.     }
  40.     closegraph();
  41. }
Add Comment
Please, Sign In to add comment