#include
#include
using namespace std;
int main () {
map < string , string > nomi;
map < string , int> yili;
map < string , int> razryad;
map < string , string> turi;
map < string , int> imkoniyatlar;
nomi.emplace("cplusplus","C++");
yili.emplace("cplusplus",1985);
razryad.emplace("cplusplus",32);
turi.emplace("cplusplus","backend");
imkoniyatlar.emplace("cplusplus",100);
nomi.emplace("Python","Python");
yili.emplace("Python",1991);
razryad.emplace("Python",64);
turi.emplace("Python","backend");
imkoniyatlar.emplace("Python",150);
nomi.emplace("java","Java");
yili.emplace("java",1980);
razryad.emplace("java",64);
turi.emplace("java","backend");
imkoniyatlar.emplace("java",255);
cout<<"Nomlar royhati: cplusplus, Python, java\n";
cout<<"uchta sondan birini tanlang: \n";
char s[10];
cin>>s;
cout<<"\n\nNomi "<second;
cout<<"\nyili: "<second;
cout<<"\nrazryadgla soni: "<second;
cout<<"\nturi: "<second;
cout<<"\nimkoniyatlar soni: "<second;
ofstream fayl;
fayl.open("zapis.txt");
cout<<"\n\nFaylga yozish uchun 1 yoki 0 kiriting: ";
int q;
cin>>q;
if (q)
{
fayl<second<second;
fayl<second<second;
fayl<second;
cout<<"\nFaylga yozildi";
}
else
{
cout<<"Faylga yozilmadi";
}
}
2-vazifa:
NAVBAT ni juft o‘rinda turgan elementlari o‘chirilsin.
Bajarilishi:
#include
#include
#include
using namespace std;
int main () {
int x;
queue chis;
cout<<"Berilgan sonlar toplamlar: ";
chis.emplace(73);
cout<<"73 ";
chis.emplace(25);
cout<<"25 ";
chis.emplace(98);
cout<<"98 ";
chis.emplace(26);
cout<<"26 ";
chis.emplace(75);
cout<<"75 ";
chis.emplace(65);
cout<<"65 ";
chis.emplace(45);
cout<<"45 ";
chis.emplace(36);
cout<<"36";
int k=1,s=0;
cout<<"\n Juft elementlarini ochirdim va ekranga chiqardim: ";
while(!chis.empty())
{
if (k%2==0)
cout<
k++;
chis.pop();
}
}
__________________________________________________________________________________________________________________________
Asosiy adabiyotlar:
Moʻminov B.B., Dasturlash I. Oʻzbekiston Respublikasi Oliy va oʻrta maxsustaʻlim vazirligi. – T.: «NAMUNA», 2020. –311 b.
Nazirov SH.A., Qobulov R.V., Bobojanov M.R., Raxmanov Q.S. S va C++ tili. “Voris- nashriyot” MCHJ, Toshkent 2013, 488 b.
Horstmann, Cay S. C++ for everyone/Cay S. Horstmann. Printed in the United States of America - 2nd ed. 2010. – P. 562.
Horton I.-Beginning Visual C++ 2012/ I.Horton. Published simultaneously in Canada.–2012. –P. 988.
https://drive.google.com/file/d/1Ans7TBsQBsX_tMIYxURZcLkc_Kp7sAiX/view?usp=sharing
https://drive.google.com/file/d/1HYvMsbIsgUYGfWJj_uxxiR_S9G6G2Q-O/view?usp=sharing
Do'stlaringiz bilan baham: |