Ismoilova Shohidaning dasturlash 2 fanidan 2-topshiriq javobi. Tekshirdi: Xaydarova Marxamat


Download 269.01 Kb.
Sana06.04.2023
Hajmi269.01 Kb.
#1329717
Bog'liq
ismoilova shohida2


Al Xorazmiy nomidagi Toshkent Axborot texnologiyalari univarsitetining kasbiy talim fakulteti 1-kurs talabasi Ismoilova Shohidaning dasturlash 2 fanidan 2-topshiriq javobi.

Tekshirdi: Xaydarova Marxamat.




#include
#include
#include
#include
using namespace std;
int main()
{
srand(time(NULL));
set s;
multiset M{2,3,5,6,7};
multiset::iterator it;
it=M.begin();
float a;
cout<for (auto i=M.begin(); i!=M.end(); i++)
{
cout<<*i<<" ";
}
cout<cout<for (auto i=M.begin(); i!=M.end(); i++)
{
cout<<(*i)+(*it+1)<<" ";
}
auto k = M.begin();
auto l = M.begin();
for (int i = 0; i < 5; i++)
{
s.insert(*k);k++;
s.insert(*l); l++;
}
cout<cout<for (auto i=s.begin(); i!=s.end(); i++)
{
cout<<*i<<" ";
}
getchar();
return 0;
}



#include
#include
#include
using namespace std;
int main()
{
int n; bool t=false;
cout<<"kompyuterlar sonini kiriting: "; cin>>n; cin.ignore();
multimap M, M2;
for (int i = 0; i < n; i++)
{
string St;
int step,mem,age;
cout<cout<<"nomi: "; getline(cin,St);
cout<<"yadrosi: "; cin>>step; cin.ignore();
cout<<"xotirasi: "; cin>>mem; cin.ignore();
cout<<"yili: "; cin>>age;cin.ignore();
M.insert(pair(St,step));
}
string S;
int N;
cout<<"qaysi yildagi komp haqida ma'lumot kerak?:";
cin>>N;
int k=0;
for (auto it = M.begin(); it != M.end(); ++it){
S = it->first;
if(S.find(" ")second == N){
M2.insert(pair(S,N));t=true;}
}
cout<<"So'rov Natijasi:"<if(t){ cout<<"bor"<for (auto it = M2.begin(); it != M2.end(); ++it){
cout<first<<" "<second<}
}
system("pause");
return 0;
}

Download 269.01 Kb.

Do'stlaringiz bilan baham:




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