Пример. Использование процедур.
#include <graphics.h>
#include <conio.h>
void triangle ( int x, int y );
void main()
{
int grDriver = VGA, grMode = VGAHI;
initgraph ( &grDriver, &grMode, "C:\\BORLANDC\\BGI" );
triangle (100, 100 );
triangle (140, 100 );
triangle (140, 100 );
getch();
closegraph();
}
void triangle ( int x, int y )
{
line ( x, y, x + 20, y - 50 );
line ( x, y, x + 40, y );
line ( x + 40, y, x + 20, y - 50 );
}
2009-12-19 • Просмотров [ 8331 ]