
Untitled
By: a guest on
May 20th, 2012 | syntax:
C++ | size: 1.45 KB | hits: 15 | expires: Never
#include <stdlib.h>
#include <stdio.h>
#include <conio2.h>
#include <time.h>
#include <ramka.c>
void tabliczka(int k, int w)
{
textcolor(12);
ramka(15, 3, 42, 16);
for(int i=1; i<11; i++)
{
gotoxy(k, w+i-1);
for(int j=1; j<=10; j++)
{
printf("%4d", i*j);
}
printf("\n\r");
}
int a = 1+rand()%10;
int b = 1+rand()%10;
int ab = a*b;
gotoxy(k+4, w+14);
textcolor(12);
printf ("Losowe liczby: %d i %d", a, b);
gotoxy(k+4, w+15);
textcolor(14);
printf("%d %c %d = %d", a, 250, b, ab);
}
//-----------------------------------
int main(int argc, char *argv[])
{
srand(time(NULL));
tabliczka(4,5);
getch();
return 0;
}
void ramka_()
{
for(int i=0;i<58;i++)
{
gotoxy(6+i,5);
printf("%c",196);
gotoxy(6+i,14);
printf("%c",196);
}
for(int i=0;i<8;i++)
{
gotoxy(5,6+i);
printf("%c",179);
gotoxy(64,6+i);
printf("%c",179);
}
gotoxy(5,5);printf("%c",218);
gotoxy(64,14);printf("%c",217);
gotoxy(5,14);printf("%c",192);
gotoxy(64,5);printf("%c",191);
}
//-----------------------------------