Funksiyalar yordamida turli tasvirlarni chizish dasturini yaratish


Quyida C++ dasturida Lacetti aftomobilini tuzish programmasi berilgan


Download 178.11 Kb.
bet2/3
Sana23.12.2022
Hajmi178.11 Kb.
#1046379
1   2   3
Bog'liq
9-mavzu dasturlash

Quyida C++ dasturida Lacetti aftomobilini tuzish programmasi berilgan.

#include
#include
#include
using namespace std;
int main()
{
initwindow(754,460);
setcolor(WHITE);
circle(184, 314, 44); circle(184, 314, 31); circle(184, 314, 7);
circle(552, 311, 44); circle(552, 311, 31); circle(552, 311, 7);
setfillstyle(1, WHITE);
floodfill(170, 314, WHITE); ellipse(231, 247, 0, 360, 7, 3);
floodfill(540, 311, WHITE); setfillstyle(1, COLOR(255, 121, 0));
floodfill(231, 247, WHITE);
line(232, 321, 503, 318);
arc(184, 314, -10, 190, 49);
arc(552, 311, -10, 190, 49);
setcolor(BLACK);
circle(184+10, 314+10, 3);
circle(184+10, 314-10, 3);
circle(184-10, 314+10, 3);
circle(184-10, 314-10, 3);
circle(552+10, 311+10, 3);
circle(552+10, 311-10, 3);
circle(552-10, 311+10, 3);
circle(552-10, 311-10, 3);
setcolor(WHITE);
//orqasi
ellipse(600, 308, 270, 352, 10, 11);
line(609, 308, 664, 302);
line(679, 262, 682, 286);
ellipse(664, 286, -90, 0, 18, 16);
ellipse(673, 262, 0, 90, 6, 8);
ellipse(673, 245, 180, 270, 5, 9);
ellipse(654, 245, 0, 90, 14, 42);
//fara
line(639, 218, 654, 238);
ellipse(668, 238, 180, 270, 14, 8);
ellipse(644, 218, 90, 180, 5, 16);
setfillstyle(1, RED);
floodfill(660, 238, WHITE);
//putpixel(660, 238, GREEN);
line(602, 197, 654, 203);
//putpixel(100, 252, GREEN);
setfillstyle(1, COLOR(0, 0, 0));
floodfill(100, 252, WHITE);
//setfillstyle(1, COLOR(255, 255, 255));
//floodfill(10, 10, WHITE);
//oldi
line(86, 314, 134, 320); 
line(118, 237, 240, 212);
line(67, 280, 67, 292);
ellipse(86, 292, 180, 270, 19, 22);
ellipse(76, 280, 90, 180, 9, 8);
ellipse(76, 265, -90, 0, 7, 7);
ellipse(118, 265, 90, 180, 35, 28);
ellipse(83, 237, -90, 0, 40, 28);

Download 178.11 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling