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

Untitled

By: a guest on May 20th, 2012  |  syntax: C++  |  size: 1.45 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. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <conio2.h>
  4. #include <time.h>
  5. #include <ramka.c>
  6.  
  7. void tabliczka(int k, int w)
  8. {
  9.      textcolor(12);
  10.      ramka(15, 3, 42, 16);
  11.      for(int i=1; i<11; i++)
  12.      {
  13.              gotoxy(k, w+i-1);
  14.              for(int j=1; j<=10; j++)
  15.              {
  16.                      printf("%4d", i*j);
  17.              }
  18.      printf("\n\r");
  19.      }
  20.      
  21.      int a = 1+rand()%10;
  22.      int b = 1+rand()%10;
  23.      int ab = a*b;
  24.      gotoxy(k+4, w+14);
  25.      textcolor(12);
  26.      printf ("Losowe liczby: %d i %d", a, b);
  27.      gotoxy(k+4, w+15);
  28.      textcolor(14);
  29.      printf("%d %c %d = %d", a, 250, b, ab);
  30.      
  31. }
  32. //-----------------------------------
  33. int main(int argc, char *argv[])
  34. {
  35.     srand(time(NULL));
  36.     tabliczka(4,5);
  37.     getch();
  38.     return 0;
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. void ramka_()
  50. {
  51.      for(int i=0;i<58;i++)
  52.      {
  53.              gotoxy(6+i,5);
  54.             printf("%c",196);
  55.            
  56.              gotoxy(6+i,14);
  57.             printf("%c",196);
  58.             }
  59.       for(int i=0;i<8;i++)      
  60.             {
  61.             gotoxy(5,6+i);
  62.             printf("%c",179);
  63.            
  64.             gotoxy(64,6+i);
  65.             printf("%c",179);
  66.            
  67.              }
  68.              gotoxy(5,5);printf("%c",218);
  69.              gotoxy(64,14);printf("%c",217);
  70.              gotoxy(5,14);printf("%c",192);
  71.              gotoxy(64,5);printf("%c",191);
  72.      }
  73. //-----------------------------------