14) Map hosil qiling. Uni elementlar bilan to’ldiring. M kalitni kiriting agar kalit mavjud, bo’lsa o’chirsin aks holda mapda bunday kalit yo’qligi haqida xabar bersin.\
#include
#include
#include
using namespace std;
int main(){string M;
cout<<"=";cin>>M;
mapA={{"fly","uchmoq"},{"book","kitob"},{"home","uy"},{"time","vaqt"},{"pen","ruchka"}};
for(auto it=A.begin(); it!=A.end();it++){
if(it->first==M)
A.erase(it->first);
}
for(auto it=A.begin(); it!=A.end();it++){
cout<< it->first<<" "<second<
return 0;}
15) Lugat dan iborat map hosil qiling. Kalitga mos qiymatlarni kiriting. Agar tarjima to’g’ri bo’lsa, yakunida jammi ball hisoblansin. Har bir to’g’ri so’z 1 balldan baholang.
#include
#include
#include
using namespace std;
int main(){string a;int ball=0;
mapTarjimon={{"fly","uchmoq"},{"book","kitob"},{"home","uy"},{"time","vaqt"},{"pen","ruchka"}};
for(auto it=Tarjimon.begin(); it!=Tarjimon.end();it++){
cout<< it->first<<"=";cin>>a;
if(it->second==a){
cout<<"tarjima togri"<
ball++;
}
else
{
cout<<"tarjima xato"<
}
}
cout<<"BALL:"<
return 0;}
16) Matematik misollar va ularning natijasi berilgan. Agar o’quvchi masalalarni to’g’ri yechsa, 2 balldan xató yechsa 1 balldan kamaytirib umumiy ballni hisoblovchi dastur tuzing.
#include
#include
#include
using namespace std;
int main(){int a;int ball=0;
Do'stlaringiz bilan baham: |