Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: C  |  size: 1.33 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void graph_drawer()
  2. {  system("cls");
  3.         //=========================================================================================
  4.  
  5.         HANDLE consoleOutput;
  6.         consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
  7.  
  8.         //=========================================================================================
  9.         const int left = 80/2-32/2;
  10.         const int top  = 20/2-6/2;
  11.                 int ver[2];
  12.        
  13.                 int i;
  14.                 int     g;
  15.  
  16.         char ramka[5][33];
  17.         strcpy(ramka[0],"+------------------------------+");
  18.                 strcpy(ramka[1],"|           AREA               |");
  19.         strcpy(ramka[2],"| enter X1           y1        |");
  20.                 strcpy(ramka[3],"| enter X2           y2        |");
  21.                 strcpy(ramka[4],"+------------------------------+");
  22.         COORD position;
  23.         position.X = left;
  24.         position.Y = top;
  25.         SetConsoleTextAttribute(consoleOutput,FOREGROUND_GREEN|FOREGROUND_INTENSITY); // Цвет рамки
  26.        SetConsoleCursorPosition(consoleOutput, position);
  27.            printf("%s",ramka[0]);
  28.            for(i=1;i<5;i++)
  29.            {position.Y = top+i;
  30.  
  31.             SetConsoleCursorPosition(consoleOutput, position);
  32.        printf("%s",ramka[i]);
  33.            }
  34.            //вводим значение x
  35.            g=0;
  36.            position.X = left+11;
  37.            position.Y = top+2;
  38.             SetConsoleCursorPosition(consoleOutput, position);
  39.      scanf("%f",ver[g]);