Toshkent axborot texnologiyalari universiteti Farg`ona filiali Kompyuter injiniring


Download 0.5 Mb.
Sana16.12.2021
Hajmi0.5 Mb.
#181340
Bog'liq
1-dedline a


Dedline 1 613-20 gurux talabasi

Avazbek Ximmatov



Toshkent axborot texnologiyalari universiteti Farg`ona filiali Kompyuter injiniring fakulteti Kompyuter injiniring yo’nalishi 613-20 guruh talabasi

3-DEDLINE


1-topshiriq: Bir o’lcho’vli mаssivlаrgа mаsаlаlаr.
7. n elеmеntdаn tаshkil tоpgаn mаssiv bеrilgаn. Dаstlаb mаssiv elеmеntlаri оrаsidаn juftlаri indеkslаri o’sish tаrtibidа chiqаruvchi, kеyin mаssiv elеmеntlаri оrаsidаn tоqlаri kаmаyish tаrtibidа chiqаruvchi dаstur tuzing?

#include

using namespace std;

int main()

{int n,i;

cout<<"massivning necha elemendan iborat ekanligini belgilash uchun n ni kiriting"<

cout<<"n="; cin>>n;

int a[n];

for(int i=0;i

{cin>> a[i];}

cout<<"kiritilgan massiv elementlari:\n";

for(int i=0;i

{cout<

cout<

cout<<"massivning juft elementlarini chiqar:"<

for(int i=0;i

{if(a[i]%2==0)

cout<

}

cout<

cout<<"massivning toq elementlarini chiqar:"<

for(int i=0;i

{if(a[i]%2==1)

cout<

}

return 0;



}



Tоpshiriqlаr: ko’p o’lcho’vli mаssivlаrgа mаsаlаlаr.

7. m х n o’lchаmli mаtritsа bеrilgаn. Mаtritsаning 2 gа kаrrаli (0, 2, 4, …) sаtrlаrini chiqаruvchi dаstur tuzing.

#include

using namespace std;

int main()

{int m,n,i,j;

cout<<"m = "; cin>>m;

cout<<"n = "; cin>>n;

int a[m][n];

for(i=0;i

{cin>>a[i][j];}

}


cout<<"kiritilgan massiv elementlari:\n";

for(i=0;i

cout<

cout<<"matritsaning ikkiga karrali elementlari;" <

for(i=0; i

for(j=0;j

{

if(a[i][j]%2==0){cout<

}

return 0;



}



Tоpshiriqlаr: C++ dasturlash tilining grafik imkoniyatlaridan foydalanish

#include

#include

using namespace std;

int main()

{

initwindow(700,480,"rasm",50,10);



setcolor(BLACK);

setbkcolor(9);

cleardevice();

ellipse(230,256,105,220,124,110);

ellipse(411,303,263,47,124,120);

ellipse(327,298,188,232,203,104);

ellipse(345,375,243,322,164,52);

line(166,361,276,422);

line(461,131,474,186);

line(473,184,503,223);

line(273,80,188,152);

line(271,81,349,81);

line(348,80,400,99);

line(398,98,453,114);

line(448,110,461,131);

setfillstyle(1,6);

floodfill(231,257,BLACK);

setcolor(BLACK);

ellipse(215,50,0,270,45,50);

line(214,98,237,110);

line(257,47,273,80);

setfillstyle(1,6);

floodfill(217,57,BLACK);

setcolor(BLACK);

ellipse(445,65,333,185,16,17);

line(398,100,431,62);

line(461,84,450,112);

line(460,63,461,84);

setfillstyle(1,6);

floodfill(434,80,BLACK);

setcolor(BLACK);

ellipse(340,114,10,180,40,23);

ellipse(340,114,10,180,40,15);

setfillstyle(1,BLACK);

floodfill(340,95,BLACK);

setcolor(BLACK);

ellipse(438,138,345,165,23,25);

ellipse(435,145,5,140,24,21);

setfillstyle(1,BLACK);

floodfill(436,118,BLACK);

setcolor(BLACK);

ellipse(335,160,0,270,32,28);

line(332,187,360,190);

line(366,154,360,190);

ellipse(343,176,355,200,20,25);

circle(342,175,12);

setfillstyle(1,BLACK);

floodfill(343,172,BLACK);

setfillstyle(1,WHITE);

floodfill(330,150,BLACK);

setfillstyle(1,4);

floodfill(356,175,BLACK);

setcolor(BLACK);

ellipse(440,185,0,190,19,32);

ellipse(442,194,170,50,22,20);

ellipse(437,203,345,160,18,30);

circle(435,197,12);

setfillstyle(1,BLACK);

floodfill(437,198,BLACK);

setfillstyle(1,WHITE);

floodfill(446,171,BLACK);

setfillstyle(1,4);

floodfill(437,182,BLACK);

setcolor(BLACK);

ellipse(409,237,30,122,34,29);

ellipse(402,224,288,2,37,42);

line(390,212,412,262);

setfillstyle(1,BLACK);

floodfill(413,223,BLACK);

setcolor(BLACK);

line(348,300,399,295);

line(399,295,416,312);

ellipse(392,302,210,340,25,24);

line(348,300,370,312);

ellipse(391,296,190,329,22,21);

setfillstyle(1,WHITE);

floodfill(390,307,BLACK);

setfillstyle(1,BLACK);

floodfill(386,320,BLACK);

setcolor(BLACK);

line(170,364,158,376);

line(140,377,158,376);

line(63,415,140,377);

line(62,410,63,415);

line(33,429,62,410);

line(33,432,33,429);

line(0,460,33,432);

line(100,480,150,419);

line(33,432,70,480);

setfillstyle(1,6);

floodfill(32,454,BLACK);

setcolor(BLACK);

line(486,396,523,411);

line(523,411,570,402);

ellipse(580,384,75,240,19,22);

line(582,363,593,335);

line(612,336,604,362);

ellipse(604,376,60,130,23,44);

line(580,480,637,395);

line(602,360,637,395);

line(625,378,610,395);

line(606,360,588,377);

line(522,411,490,480);

line(491,398,467,480);

setfillstyle(1,6);

floodfill(558,445,BLACK);

setcolor(BLACK);

line(415,420,422,480);

line(405,420,355,470);

line(323,423,357,472);

line(382,441,379,482);

line(268,415,244,450);

line(246,450,160,370);

line(161,370,156,480);

line(208,413,227,485);

setfillstyle(1,WHITE);

floodfill(138,421,BLACK);

floodfill(302,458,BLACK);

floodfill(465,433,BLACK);

floodfill(495,428,BLACK);

setfillstyle(1,BLUE);

floodfill(196,429,BLACK);

floodfill(410,444,BLACK);

setfillstyle(1,7);

floodfill(230,412,BLACK);

floodfill(370,443,BLACK);

ellipse(536,312,5,106,169,110);

line(88,0,112,222);

line(122,308,132,381);

setfillstyle(1,65);

floodfill(86,198,BLACK);

setfillstyle(1,7);

floodfill(594,273,BLACK);

setcolor(BLACK);

line(0,479,699,479);

line(699,0,699,479);

line(0,0,0,480);

line(0,0,700,0);

getch();

return 0;



}


Download 0.5 Mb.

Do'stlaringiz bilan baham:




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