Funksiya grafigini piksellar yordamida chizing: y=3x



Download 95,39 Kb.
Sana18.06.2021
Hajmi95,39 Kb.
#69289
Bog'liq
2 5213296136416133996





  1. Funksiya grafigini piksellar yordamida chizing: y=3x2+4x+5

  2. Funksiya grafigini piksellar yordamida chizing: y=-2x2-5x+1

  3. Funksiya grafigini piksellar yordamida chizing: y=sin x+cos x

  4. Funksiya grafigini piksellar yordamida chizing: y=ex * sin x

  5. Funksiya grafigini piksellar yordamida chizing: y= ex * ln x

  6. Funksiya grafigini piksellar yordamida chizing: y=ex * cos x

  7. Funksiya grafigini piksellar yordamida chizing: y=ln x * sin x

  8. Funksiya grafigini piksellar yordamida chizing: y=tg x * cos x

  9. Funksiya grafigini piksellar yordamida chizing: y=sin x * ctg x

  10. Funksiya grafigini piksellar yordamida chizing: y=-2x4-5x2+1

Graphics ^gr;

gr=pictureBox1->CreateGraphics();

Bitmap ^bt=gcnew Bitmap(1,1);

Pen ^pn=gcnew Pen(Color::Green);

int xc=pictureBox1->Width/2;

int yc=pictureBox1->Height/2;

bt->SetPixel(0,0,Color::Black);

float x0=-10;

int x,y;

while(x0<10)

{

x=50*x0;


y=50*Math::Sin(x0);

gr->DrawImageUnscaled(bt,xc+x,yc-y);

x0=x0+0.001;

}


gr->DrawLine(pn,xc,0,xc,pictureBox1->Height);

gr->DrawLine(pn,0,yc,pictureBox1->Width,yc);


String0./// ixtiyoriy matin berilgan.matindagi eng uzun va eng qisqa so'zlarni aniqlovchi dastur tuzing
#include

using namespace std;

int main(){

string s,a,b;

int min = 1000000,max = 0;

while( cin >> s ){

if( max < s.length() ){

a = s;


max = s.length();

}

if(min > s.length()){



b = s;

min = s.length();

}

}

cout << a << " " << b;



}

String2./// ixtiyoriy matin berilgan. matinda qatnashgan raqamlar yig'ndisim=ni topuvchi dastur tuzing

#include

using namespace std;

int main(){

string s;

int a = 0;

while( cin >> s ){

for(int i = 0; i < s.length(); i++){

if(s[i] <= '9' && s[i] >= '0'){

a += s[i] - '0';

}

}



}

cout << a;

}

String3./// ixtiyoriymatn berilgan matindagi ortiqcha bo'sh joy olib tashlab eng uzun va qisqa so'zlarni aniqlovchi dastur tuzing

#include

using namespace std;

int main(){

string s,a,b;

int min = 1000000,max = 0;

while( cin >> s ){

if( max < s.length() ){

a = s;


max = s.length();

}

if(min > s.length()){



b = s;

min = s.length();

}

}

cout << a << " " << b;



}
String4./// matindagi so'zlar nuqta, vergul va bo'sh joy bilan ajrating. Matindagi polindrom sozlarni aniqlovchi dastur tuzing

#include

using namespace std;

int main(){

string s,txt[100];

int ans = 1;

while(cin >> s){

int cnt = 0;

if(!((s[s.length()-1] <= 'z' && s[s.length()-1] >= 'a') || (s[s.length()-1] <= 'Z' && s[s.length()-1] >= 'A'))){

s.erase(s.length()-1,1);

}

for(int i = 0;i < s.length()/2; i++){



if(s[i] != s[s.length() - i - 1])

cnt++;


}

if(cnt == 0){

txt[ans++] = s;

}

}



for(int i = 1;i<=ans;i++){

cout << txt[i] << " ";

}

}
String5.///matindagi eng ko'p qatnashgan so'zlarni aniqlovchi tastur tuzing



#include

using namespace std;

int a[100],mx = 0,ind,cnt;

int main(){

string s,txt[100];

int ans = 1;

while(cin >> s){

txt[ans++] = s;

}

for(int i=1;i<=ans;i++){



s = txt[i];

cnt = 0;


for(int j=1;j<=ans;j++){

if(txt[j] == s){

cnt++;

}

}



a[i] = cnt;

}

for(int i = 1;i<=ans;i++){



if(mx < a[i]){

mx = a[i];

ind = i;

}

}



cout << txt[ind];

}


String6.///matindagi faqat 1 marta qatnashgan so'zlarni aniqlovchi dastur tuzing

#include

using namespace std;

int a[100],mn = 1000000,ind,cnt;

int main(){

string s,txt[100];

int ans = 1;

while(cin >> s){

txt[ans++] = s;

}

for(int i=1;i<=ans;i++){



s = txt[i];

cnt = 0;


for(int j=1;j<=ans;j++){

if(txt[j] == s){

cnt++;

}

}



a[i] = cnt;

}

for(int i = 1;i<=ans;i++){



if(mn > a[i]){

mn = a[i];

ind = i;

}

}



cout << txt[ind];

}
String 7.///Matindagi "dastur" so'zi necha martaqatnashganligini aniqlovchi tastur tuzing

#include

using namespace std;

int main(){

string s = "dastur",txt[100];

int i = 1,cnt = 0;

while(cin >> txt[i]){

if(txt[i++] == s)

cnt++;


}

cout << cnt;

}
String8/// matindagi eng uzun so’z bilan eng qisqa so’zni o’rnini almashtiruvch dastur tuzing

#include

using namespace std;

int main(){

string s,txt[100];

int id1,id2,mx = 0,mn = 10000000,i=1;

while(cin >> s){

txt[i] = s;

if(mx < s.length()){

mx = s.length();

id1 = i;

}

if(mn > s.length()){



mn = s.length();

id2 = i;


}i++;}

swap(txt[id1],txt[id2]);

for(int j=1;j<=i;j++){

cout << txt[j] << " ";}}

String9.///matindagi berilgan k so’z bilan l so’zga almashtiruvchi dastur tuzing
#include

using namespace std;

int main(){

string s,txt[100];

int k,l,i=1;

cin >> k >> l;

while(cin >> s){

txt[i++] = s; }

swap(txt[k],txt[l]);

for(int j=1;j

cout << txt[j] << " "; }}

string10./// matindagi faqat raqammlardan tashkil topgan sozni aniqlovchi dastur tuzing

#include

using namespace std;

bool son(string s){

for(int i=0;i

if(s[i] < '0' || s[i] > '9')

return false;

return true;

}

int main(){



string s,txt[100];

int i=1;


while(cin >> s){

if(son(s) == true){

txt[i++] = s;

}

}



for(int j=1;j<=i;j++){

cout << txt[j] << " ";

}

}
String11./// matindagi unli harflarni aniqlovchi dastur tuzing



#include

using namespace std;

int main(){

string s;

int cnt = 0;

while(cin >> s){

for(int i = 0;i

if(s[i] == 'a' || s[i] == 'u' || s[i] == 'o' || s[i] == 'i' || s[i] == 'e' || s[i] == 'A' || s[i] == 'U' || s[i] == 'O' || s[i] == 'I' || s[i] == 'E'){

cnt++;

}

}



}

cout << cnt;

}
String12./// matindagi n-so’z bilan m-so’zlarni o’rnini almashtiruvchi dastur tuzing

#include

using namespace std;

int main(){

string s,txt[100];

int n,m,i=1;

cin >> n >> m;

while(cin >> s){

txt[i++] = s;

}

swap(txt[n],txt[m]);



for(int j=1;j

cout << txt[j] << " ";

}}
Fayl.1./// faylda har birunli harflardan necha marta qatnashganligini aniqlovchi dastur tuzing

#include

using namespace std;

int main(){

string s;

ifstream fin("input.txt");

int cnt_a = 0,cnt_u = 0,cnt_o = 0,cnt_i = 0,cnt_e = 0;

while(!fin.eof()){

getline(fin,s);

for(int i=0;i

if(s[i] == 'a' || s[i] == 'A'){

cnt_a++; }

if(s[i] == 'u' || s[i] == 'U'){

cnt_u++; }

if(s[i] == 'o' || s[i] == 'O'){

cnt_o++; }

if(s[i] == 'e' || s[i] == 'E'){

cnt_e++; }

if(s[i] == 'i' || s[i] == 'I'){

cnt_i++; } } }

cout << "a harfi " << cnt_a << " marta qatnashgan" << endl;

cout << "u harfi " << cnt_u << " marta qatnashgan" << endl;

cout << "o harfi " << cnt_o << " marta qatnashgan" << endl;

cout << "e harfi " << cnt_e << " marta qatnashgan" << endl;

cout << "i harfi " << cnt_i << " marta qatnashgan" << endl;

fin.close();}

fayl2.///faylda harbir satirda eng uzuzn so’zni aniqlab yangi faylga yozish dasturini tuzing

#include

using namespace std;

int main(){

string s,ss,mxs[100];

ifstream fin("input.txt");

int ans=1;

while(!fin.eof()){

getline(fin,s);

int i=0,mx=0;

while(i

int j=0;


while(s[i] != ' '){

ss[j++] = s[i++]; }

if(mx < ss.length()){

mx = ss.length();

mxs[ans++] = ss; }

i++ }


fin.close();

ofstream fout("input2.txt");

for(int t = 1;t < ans;t++){

fout << mxs[t]; }

fout.close();}

2. Matnli fayl berilgan. Fayldagi a xarfi bilan boshlangan……………..

#include

using namespace std;

int main()

{

string S;



while(cin>>S)

{

if(S[0]=='a') {cout<

}

}

3. Ishchilarning familiyasi, ismi, mutaxasisligi va maoshi bo’yicha ………….

#include

using namespace std;

class Ishchi{

private:


string familiya, ism, mutaxasisligi;

int maoshi;

public:

void ishchilar(string f,string i,string k, int m){

familiya=f; ism=i; mutaxasisligi=k; maoshi=m;

if(maoshi<1000000) {

cout<<"Ishchining familiyasi: "<

cout<<"Ishchining ismi: "<

cout<<"Ishchining mutaxasisligi: "<

cout<<"Ishchining maoshi: "<

}

}

};



int main() {

Ishchi I;

int n;

string N[1000],A[1000],S[1000];



int B[1000];

cin>>n;


for(int i=1; i<=n; i++){

cout<<"Ishchining familiyasini kiriting: "; cin>>N[i];

cout<<"Ishchining ismini kiriting: "; cin>>A[i];

cout<<"Ishchining mutaxasisligini kiriting: "; cin>>S[i];

cout<<"Ishchining maoshini kiriting: "; cin>>B[i];

}

for(int i=1; i<=n; i++){



I.ishchilar(N[i],A[i],S[i],B[i]);

}

}


2. Matnli fayl berilgan. Fayldagi birinchi so’z bilan oxirgi so’z almashtirib yangi fatlga yozish dasturi tuzing.
#include

using namespace std;

int main()

{

string S;



string w[100];

int m,x=0,y=0;

ifstream f("input.txt");

ofstream g("output.txt");

while(!f.eof())

{

getline(f,S);



S+=" ";

for(int i=0; i

{

if(S[i]==' '){



w[x++]=S.substr(y,i-y);

y=i+1;


}

}

string r;



r=w[0];

w[0]=w[x-1];

w[x-1]=r;

for(int i=0; i

{

g<

3. Turli ko’rinishdagi uchburchaklarni yuzalarini hisoblovchi uchburchak sinfi yarating va u yordamida teng tamonli, to’g’ri burchakli va turli tamonli uchburchak yuzalarini hisoblovchi dastur tuzing.

#include

using namespace std;

class Uchburchak{

private:

int a;


int b;

int c;


public:

void tengtamonli(int a_tamon)

{

a=a_tamon;



cout<<"teng tamonli uchburchak yuzi S="

<

}

void togri_burchakli(int a_tamon,int b_tamon)



{

a=a_tamon;

b=b_tamon;

cout<<"to'g'ri burchakli uchburchak yuzi S="<

}

void turli_tamonli(int a_tamon,int b_tamon,int c_tamon)



{

a=a_tamon;

b=b_tamon;

c=c_tamon;

double p=(a+b+c)*1./2;

cout<<"turli tamonli uchburchak yuzi S="<

}

};

int main()



{

Uchburchak U;

U.tengtamonli(3);

U.togri_burchakli(3,4);

U.turli_tamonli(3,4,5); }

2. Ixtiyoriy matn berilgan. Matndagi eng uzun va qisqa so’zlarni aniqlovchi dastur tuzing.
#include

using namespace std;

int main()

{

string S,w[1000];



int k=0,y=0,m,b,minn=INT_MAX,maxx=INT_MIN;

getline(cin,S);

S+=" ";

for(int i=0; i<=S.length(); i++)

{

if(S[i]==' ')



{

w[k++]=S.substr(y,i-y);

y=i+1;

}

}



for(int i=0; i

{

int p=w[i].length();



if(p

if(p>maxx) {maxx=p; b=i;}

}

cout<<"eng uzun so'z -> "<

cout<<"eng qisqa so'z -> "<

}

3. ”Talaba” nomli struktura berilgan. Berilgan yo’nalishda oqiydigan talabalarni ro’yxatini chiqaruvchi dastur tuzing

#include

using namespace std;

struct Talaba{

string familiya,ism,adres,yonalish;

int kurs;};

int main()

{

Talaba T[1000];



int n;

cin>>n;


for(int i=1; i<=n; i++)

{

cout<<"Talaba familiyasini kiriting: ";



cin>>T[i].familiya;

cout<<"Talaba ismini kiriting: ";

cin>>T[i].ism;

cout<<"Talaba adresini kiriting: ";

cin>>T[i].adres;

cout<<"Talaba kursini kiriting: ";

cin>>T[i].kurs;

cout<<"Talaba yo'nalishini kiriting: ";

cin>>T[i].yonalish; cout<

}

string A,r="Kampyuter_injiner";



for(int i=1; i<=n; i++)

{

A=T[i].yonalish;



if(A==r)

{

cout<<"Talaba ism, familiyasi "<

cout<<"Yo'nalishi"<

cout<<"Adresi"<

cout<<"Kursi"<

}}}


2. Matnli fayl berilgan. Fayldagi 5 raqami necha marta qatnashgan.
#include

using namespace std;

int main()

{

string S;



int k=0;

ifstream f("input.txt");

while(!f.eof())

{

getline(f,S);



for(int i=0; i

{

if(S[i]=='5')



{k++;}

}

}



cout<

}

3. Kitob nomi,avtori va sahifalari bilan ishlovchi book sinfi tashkil qiling………..


#include

using namespace std;

class book{

private:


string nomi,avtori;

int sahifa,beti;

public:

void kitob(string n,string a,int s, int b){

nomi=n;

avtori=a;

sahifa=s;

beti=b;


if(beti>=100) {

cout<<"Kitobning nomi: "<

cout<<"Kitobning avtori: "<

cout<<"Kitobning sahifasi: "<

cout<<"Kitobning beti: "<

}

}



};

int main() {

book U;

int z;


string N[1000],A[1000];

int S[1000],B[1000];

cin>>z;

for(int i=1; i<=z; i++){

cout<<"Kitobning nomi: "; cin>>N[i];

cout<<"Kitobning avtori: "; cin>>A[i];

cout<<"Kitobning sahifa: "; cin>>S[i];

cout<<"Kitobning beti: "; cin>>B[i];

}

for(int i=1; i<=z; i++)



{

U.kitob(N[i],A[i],S[i],B[i]); }}



3. Shablonlardan foydalanib turli tipdagi massivlarning..........
#include

using namespace std;

template

massiv xursand(massiv a[], int n)

{

massiv maxx=INT_MIN,minn=INT_MAX;



for(int i=1; i<=n; i++)

{

if(a[i]>maxx) {maxx=a[i];}



if(a[i]

}

return maxx,minn;



}

int main()

{

int a[]={1,4,8,2,3,7};



int n=sizeof(a)/sizeof(int);

cout<<"eng katta va eng kichik elementi "<

return 0;

}


2. Ixtiyoriy matn berilgan. Matndagi T xarfdan………..

#include

using namespace std;

int main()

{

string S;



while(cin>>S)

{

if(S[0]=='T') {cout<

3. “Oshxona” nomli struktura berilgan. (bunda ……….)

#include

using namespace std;

struct Oshxona{

string tavom_nomi, turi;

int narxi;

};

int main(){



int n;

Oshxona O[1000];

cin>>n;

for(int i=1; i<=n; i++){

cout<<"Tavom nomini kiriting: ";

cin>>O[i].tavom_nomi;

cout<<"Tavomning turini kiriting: ";

cin>>O[i].turi;

cout<<"Tavomning narxini kiriting: ";

cin>>O[i].narxi; cout<

}

int A,r;


cout<<"Tavom qaysi narxdan yuqori bo'lsin "; cin>>r; cout<

for(int i=1; i<=n; i++){

A=O[i].narxi;

if(A<=r) {

cout<<"Tavomning nomi: "<

cout<<"Tavomning turi: "<

cout<<"Tavomning narxi: "<

}

}



}

3.Matnli fayl berilgan. Fayldagi ayokiA xarfi bilan boshlangan so’zlarni aniqlab A_xarf.txt fayliga yozish dasturini tuzing.
#include

using namespace std;

int main ()

{

int t=0;



string s[100000];

ifstream oqi ("text.txt");

ofstream yoz ("A_xarf.txt");

while ( !oqi.eof() )

{

oqi >> s[++t];



}

for (int i=1; i<=t; i++)

{

if ( s[i].at(0) == 'A' || s[i].at(0) == 'a')



{

yoz << s[i] << " ";

}

}

}



4.Matnlifaylberilgan. Fayldagi K - satrdagimatnbilan L – satrdagimatnnio’zaroalmashtishdasturinituzing.

#include

using namespace std;

int main ()

{

int t=0 , K , L;



string s[100000];

ifstream oqi ("text.txt");

while ( !oqi.eof() )

{

getline (oqi,s[++t]);



}

cin >> K >> L;

for (int i=1; i<=t; i++)

{

if ( i==K )



{

cout << s[L] << endl;

i++;

}

if ( i==L )



{

cout << s[K] << endl;

i++;

}

cout << s[i] << endl;



}

}

5.Matnli fayl berilgan. Fayldagi juft qatordagi matnlardan yangi fayl tashkil etish dasturini tuzing.


#include

using namespace std;

int main ()

{

int t=0;



string s[100000];

ifstream oqi ("text.txt");

ofstream yoz ("text_yangi.txt");

while ( !oqi.eof() )

{

getline (oqi,s[++t]);



}

for (int i=2; i<=t; i+=2)

{

yoz << s[i] << endl;



}

}

6. Matnli fayl berilgan. Fayldagi matnlarni alfavit bo’yicha saralab yangi faylga yozish dasturini tuzing.


#include

using namespace std;

int main ()

{

int t=0;



string s[100000];

ifstream oqi ("text.txt");

ofstream yoz ("text_yangi.txt");

while ( !oqi.eof() )

{

oqi >> s[++t];



}

sort(s+1,s+t+1);

for (int i=1; i<=t; i++)

{

cout << s[i] << " ";



}

}

7.Matnlifaylberilgan. Fayldagi harbir satrdagi belgilar sonini aniqlovchi dastur tuzing.

#include

using namespace std;

int main ()

{

int t=0;



string s[100000];

ifstream oqi ("text.txt");

while ( !oqi.eof() )

{

getline (oqi,s[++t]);



}

for (int i=1; i<=t; i++)

{

cout << s[i].length() << endl;



}

}

9.Matnli fayl berilgan. Fayldagi oxirgi n ta satrini “Yangi.txt” fayliga yozish dasturini tuzing

#include

using namespace std;

int main ()

{

int t=0 , n;



string s[100000];

ifstream oqi ("text.txt");

ofstream yoz ("yangi.txt");

while ( !oqi.eof() )

{

getline (oqi,s[++t]);



}

cin >> n;

for (int i=n; i<=t; i++)

{

yoz << s[i] << endl;



}

}

10.Matnlifaylberilgan. Fayldagi k-satrida nechta raqam qatnashganligini aniqlovchi dastur tuzing.


#include

using namespace std;

int main ()

{

int t=0 , k , x=0 ;



string s[100000] , m ;

ifstream oqi ("text.txt");

while ( !oqi.eof() )

{

getline (oqi,s[++t]);



}

cin >> k;

m = s[k];

for (int i=0; i<=s[k].length(); i++)

{

if ( '0' <= m[i] && m[i] <= '9')



{

x++;


}

}

cout << x ;



}

11.Matnli fayl berilgan. Fayldagi eng qisqa so’zni aniqlovchi dastur tuzing.

#include

using namespace std;

int main ()

{

int t=0;


string s[10000];

ifstream oqi ("text.txt");

while ( !oqi.eof ())

{

oqi >> s[++t];



}

int minn,x=0,p;

minn = s[1].length();

for (int i=1; i<=t; i++)

{

p=s[i].length();



if (minn>=p)

{

swap (minn,p);



swap (x,i);

}

}



cout << s[x];

}


12. Matnli fayl berilgan. Fayldagi birnchi so’z bilan oxirgi so’zni o’rnini almashtirib yangi faylga yozish dasturini tuzing.

#include

using namespace std;

int main ()

{

int t=0;


string s[10000];

ifstream oqi ("text.txt");

while ( !oqi.eof ())

{

oqi >> s[++t];



}

for (int i=1; i<=t; i++)

{

if ( i == 1 )



{

cout << s[t] << " ";

i++;

}

if ( i == t )



{

cout << s[1] << " ";

i++;

}

cout << s[i] << " ";



}

}


3. Matnli fayl berilgan. Fayldagi a yoki A xarfi bilan boshlangan so’zlarni aniqlab A_xarf.txt fayliga yozish dasturini tuzing.

4. Matnli fayl berilgan. Fayldagi K - satrdagi matn bilan L – satrdagi matnni o’zaro almashtish dasturini tuzing.

5. Matnli fayl berilgan. Fayldagi juft qatordagi matnlardan yangi fayl tashkil etish dasturini tuzing.

6. Matnli fayl berilgan. Fayldagi matnlarni alfavit bo’yicha saralab yangi faylga yozish dasturini tuzing.

7. Matnli fayl berilgan. Fayldagi har bir satrdagi belgilar sonini aniqlovchi dastur tuzing.

8. Matnli fayl berilgan. Fayldagi birinchi gapdagi so’zlarni uzunliklari bo’yicha o’sish tartibida joylashtirib, yangi Tartib.txt fayliga yozish dasturini tuzing.

9. Matnli fayl berilgan. Fayldagi oxirgi n ta satrini “Yangi.txt” fayliga yozish dasturini tuzing.

10. Matnli fayl berilgan. Fayldagi k-satrida nechta raqam qatnashganligini aniqlovchi dastur tuzing.

11. Matnli fayl berilgan. Fayldagi eng qisqa so’zni aniqlovchi dastur tuzing.

12. Matnli fayl berilgan. Fayldagi birnchi so’z bilan oxirgi so’zni o’rnini almashtirib yangi faylga yozish dasturini tuzing.




1-misol (class)
#include

using namespace std;

class massiv{

public:


int k=0,S=0,minn=INT_MAX,maxx=INT_MIN;

void xursand(int m)

{

if(m

if(m>maxx) {maxx=m;}

}

void ortacha(int m)



{

if(minn

{

S+=m;


k++;

}

}



void pechat()

{

cout<

}

};

int main()



{

massiv M;

int n;

cin>>n;


int a[n+1];

for(int i=1; i<=n; i++)

{

cin>>a[i];



}

for(int i=1; i<=n; i++)

{

M.xursand(a[i]);



}

for(int i=1; i<=n; i++)

{

M.ortacha(a[i]);



}

M.pechat();

}

2-misol (class)
#include

#include

using namespace std;

class Ishchi{

private:

string familiyasi,ismi,mutaxassisligi;

int maoshi,staji;

public:


void ishchi(string f,string i,string m,int o,int s)

{

ofstream yoz("baza.txt");



familiyasi=f;

ismi=i;


mutaxassisligi=m;

maoshi=o;

staji=s;

if(staji>=5)

{

yoz<

}

}

};



int main()

{

Ishchi P;



string F[100],I[100],M[100];

int n,O[100],S[100];

cin>>n;
for(int i=1; i<=n; i++)

{

cout<<"Ishchining familiyasini kiriting: "; cin>>F[i];



cout<<"Ishchining ismini kiriting: "; cin>>I[i];

cout<<"Ishchining mutaxasisligini kiriting: "; cin>>M[i];

cout<<"Ishchining maoshini kiriting: "; cin>>O[i];

cout<<"Ishchining stajini kiriting: "; cin>>S[i];

}

for(int i=1; i<=n; i++)



{

P.ishchi(F[i],I[i],M[i],O[i],S[i]);

}

}

3-misol (class)


#include

using namespace std;

class book{

private:


string nomi,avtori;

int sahifa;

public:

static string nashr;

void kitob(string n, string a, int s)

{

nomi=n;



avtori=a;

sahifa=s;

if(avtori==nashr)

{

cout<<"Kitob nomi:"<

}

}

};



string book::nashr;

int main()

{

book B;


string N[100],A[100],v;

int n,S[100];

cin>>n;

for(int i=1; i<=n; i++)

{

cout<<"Kitbning nomini kiriting: "; cin>>N[i];



cout<<"Kitbning avtorini kiriting: "; cin>>A[i];

cout<<"Kitbning sahifasi kiriting: "; cin>>S[i];

}

cout<<"qaysi nashrda bo'lsin?: "; cin>>v;



book::nashr=v;

for(int i=1; i<=n; i++)

{

B.kitob(N[i],A[i],S[i]);



}

}

4-misol (matnlar)


#include

using namespace std;

int main()

{

string S;



getline(cin,S);

S+=" ";


string w[100];

int x=0,y=0;

for(int i=0; i

{

if(S[i]==' '){



w[x++]=S.substr(y,i-y);

y=i+1;


}

}

int n,m;



string r;

cin>>n>>m;

r=w[n];

w[n]=w[m];

w[m]=r;

for(int i=0; i

{

cout<

}

}


5-misol (matnlar)
#include

using namespace std;

int main()

{

string S;



int k=0;

while(cin>>S){

k=0;

for(int i=0; i<=S.length(); i++)



{

if(S[i]=='0' || S[i]=='1' || S[i]=='2' || S[i]=='3' || S[i]=='4' || S[i]=='5' || S[i]=='6' ||

S[i]=='7' || S[i]=='8' || S[i]=='9')

k++;


}

if(k==S.length()) {

cout<

}

}



}
6-misol (matnlar)
#include

using namespace std;

int main(){

string S;

getline(cin,S);

S+=" ";


string w[1000];

int x=0,y=0;

for(int i=1; i<=S.length(); i++)

{

if(S[i]==' ')



{

w[x++]=S.substr(y,i-y);

y=i+1;

}

}



int k,z,maxx=INT_MIN;

for(int i=1; i

{

int k=0;


for(int j=i; j<=x; j++)

{

if(w[i][0]==w[j][0]) {k++;}



}

if(k>maxx) {maxx=k; z=i;}

}

cout<<"Eng ko'p qatnashgan so'z: "<

}

7-misol (matnlar)
#include

using namespace std;

int main()

{

string S;



getline(cin,S);

S+=" ";


string w[1000];

int x=0,y=0;

for(int i=1; i<=S.length(); i++)

{

if(S[i]==' ')



{

w[x++]=S.substr(y,i-y);

y=i+1;

}

}



int k,z;

for(int i=0; i

{

k=0;


for(int j=0; j

{

if(w[i]==w[j]) {k++; z=i;}



}

if(k==1) {cout<

}

}

8-misol (matnlar)


#include

using namespace std;

int main()

{

string S;



getline(cin,S);

string w[1000];

S+=" ";

int x=0,y=0;

for(int i=1; i<=S.length(); i++)

{

if(S[i]==' ')



{

w[++x]=S.substr(y,i-y);

y=i+1;

}

}



int k,l;

cin>>k>>l;

w[k]=w[l];

for(int i=1; i<=x; i++)

{

cout<

}

}

9-misol (shablonlar)


#include

using namespace std;

namespace Math

{

const double P=M_PI;



double shar_hajm(int R) {return 4*P*R*R*R*1./3;}

double shar_tola_sirti(int R) {return 4*P*R*R;}

double kub_hajmi(int a) {return a*a*a;}

double kub_tola_sirti(int a) {return 6*a*a;}

}

using namespace Math;



int main(){

cout<<"Sharning hajmi: "<

cout<<"Sharning to'la sirti: "<

cout<<"Kubning hajmi sirti: "<

cout<<"Kubning to'la sirti: "<

}

10-misol (shablonlar)


#include

using namespace std;

template

massiv xursand(massiv a[], int n)

{

massiv S=0,p;



for(int i=1; i<=n; i++)

{

S+=a[i];



}

p=S*1./n;

cout<<"O'rtacha qiymatdan kichiklari: ";

for(int i=1; i<=n; i++)

{

if(p>a[i]) { cout<

}

}

int main()



{

int m;


cin>>m;

int a[m];

for(int i=1; i<=m; i++)

{

cin>>a[i];



}

xursand(a,m);

return 0;

}

11-misol (shablonlar)


#include

using namespace std;

template

Parallepiped hajm(Parallepiped a,Parallepiped b,Parallepiped c)

{

return a*b*c;



}

template

kub hajm(kub d)

{

return d*d*d;



}

int main()

{

int a,b,c;



cin>>a>>b>>c;

double d;

cin>>d;

cout<<"Parallepipetning hajmi: V="<

cout<<"Kubning hajmi: V="<
}

uvchi programma tuzilsin.

Download 95,39 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