Mаvzu: Massivlar bilan ishlash. C++ dasturlash tilining grafik imkoniyatlari. 1-topshiriq



Download 156,64 Kb.
Sana01.01.2022
Hajmi156,64 Kb.
#293225
Bog'liq
640 20 Ismoilov Baxtiyor lab-3


Labaratoriya-3
Mаvzu: Massivlar bilan ishlash. C++ dasturlash tilining grafik imkoniyatlari.
1-topshiriq: Bir o’lcho’vli mаssivlаrgа mаsаlаlаr.
20. n tа elеmеntdаn tаshkil tоpgаn mаssiv vа K, L butun sоnlаri bеrilgаn (0<=K<=LJavob:
#include

using namespace std;
int main()

{

int K ,L ,N,J=0;

cout << "K ni kiriting__ " ; cin >> K;

cout << "L ni kiriting__ " ; cin >> L;

cout << "N ta son kiriting = " ; cin >> N;

int a[N];

for( ; K<=N ; K++)

J+=K;

for( ; K<=L ; K++)

a[K]=K;

cout<<"Javob : "<

return 0;

}



2 - tоpshiriq: Ko’p o’lcho’vli mаssivlаrgа mаsаlаlаr.
20. m х n o’lchаmli mаtritsа bеrilgаn (fаqаt musbаt sоnlаr). Elеmеntlаri yig’indisi eng kаtа bo’lgаn sаtrning indеksini vа shu sаtr elеmеntlаri yig’indisini chiqаruvchi dаstur tuzing.
Javob:

#include

using namespace std;

int main()

{

int a[100][100],b[100], m, n, ustun, satr;

cout <<"ustunni kiriting__ ";

cin>>m;

cout <<"satrini kiriting__ ";

cin>>n;

for(int i=0; i

{

for(int j=0; j

{

cin >>a[i][j];

b[i]+=a[i][j];

}

}

cout <<"______________" <

ustun=b[0];

satr=1;

for(int k=0; k

{

if (ustun

{

ustun=b[k];

satr=k+1;

}

}

cout << satr << " " << ustun << endl;

return 0;

}



3 - tоpshiriq: C++ dasturlash tilining grafik imkoniyatlaridan foydalanish.



Javob:

#include

#include

using namespace std;

int main()

{

initwindow(500,500,"Ismoilov Baxtiyor", 800,100);



setbkcolor(WHITE);

cleardevice();

setcolor(BLACK);

ellipse(250,250,110,-182,50,50); ///Aylana

ellipse(250,250,200,-102,50,50); ///Aylana

ellipse(250,250,278,-48,50,50); ///Aylana

ellipse(250,250,335,99,50,50); ///Aylana

///ellipse(250,250,110,99,50,50); ///Aylana

ellipse(290,280,10,10,8,12); /// Bitta oyog'i

ellipse(250,290,100,100,8,12); ///Ikkinchi oyog'i

/*ellipse(262,208,90,180,30,70); ///Quloq 1

ellipse(285,200,70,180,30,60); ///Quloq 2

ellipse(285,160,1000,70,20,20); ///Ikkinchi quloq ulamasi

ellipse(265,153,200,100,10,15); ///Birinchi quloq ulamasi 2

ellipse(285,160,240,100,20,20); ///Ikkinchi quloq ulamasi 2

ellipse(276,237,70,150,5,60); ///Ikkinchi quloq ulamasi 3

ellipse(255,217,70,170,5,60);*/

arc(249,290,100,250,12); ///Oyog' ulamasi 1

arc(290,280,100,250,12); ///Oyog' ulamasi 2

arc(196,270,200,10,8);

ellipse(212,260,100,-140,12,12);

ellipse(245,230,10,10,8,13); ///Ko'z 1

ellipse(258,230,-90,160,7,12); ///Ko'z 2

setcolor(BLACK);

circle(244,235,4);

setfillstyle(1,BLACK);

floodfill(244,235,0);

setcolor(WHITE);

circle(245,234,1);

setfillstyle(1,WHITE);

floodfill(245,234,WHITE);

setbkcolor(WHITE);

setcolor(BLACK);

setcolor(BLACK);

circle(257,233,4);

setfillstyle(1,BLACK);

floodfill(257,233,0);

setcolor(WHITE);

circle(258,232,1);

setfillstyle(1,WHITE);

floodfill(258,232,WHITE);

setbkcolor(WHITE);

setcolor(BLACK);

circle(253,245,6);

ellipse(285,264,500,200,100,30);

arc(308,277,200,7,7);

ellipse(299,270,310,110,5,10);

ellipse(299,270,10,90,20,15);

ellipse(278,267,340,1,40,30);

ellipse(254,180,244,305,50,80);

ellipse(258,256,290,5,12,18);

ellipse(272,256,189,-111,30,18);

ellipse(258,253,215,-30,4,12);

ellipse(262,252,240,-30,4,12);

ellipse(252,273,35,-220,4,10);

ellipse(255,274,30,-250,4,8);

ellipse(244,230,55,-218,10,20);

ellipse(245,227,55,-218,10,15);

ellipse(260,232,50,-250,10,20);

ellipse(261,236,50,-240,10,25);

///Quloqlar qaytadan:

ellipse(260,182,167,-150,30,50);

ellipse(282,175,130,-185,50,47);

ellipse(260,168,80,-259,50,30);

ellipse(233,154,5,10,40,50);

ellipse(258,147,-2,50,15,10);

ellipse(260,150,-150,1,13,10);

ellipse(297,185,147,-200,50,48);

ellipse(291,197,140,-170,50,50);

ellipse(292,200,50,-180,40,50);

ellipse(305,165,190,-50,20,20);

ellipse(270,175,-5,18,49,49);

ellipse(310,220,115,-202,52,50);

getch();


return 0;

}


Download 156,64 Kb.

Do'stlaringiz bilan baham:




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish