Uploaded by Khabibullokh

1650813942

advertisement
#include <iostream>
#include <vector>
#include <math.h>
#include <string.h>
using namespace std;
class Lugat{
public:
vector<string> word;
vector<string> mean;
string w;
string m;
void input(int n){
for (int i = 0; i < n; i++){
cout << "Lugatga sozni kiriting : " << endl;
cin >> w;
word.push_back(w);
cout << "Manosini kiriting : " << endl;
cin >> m;
mean.push_back(m);
}
}
void search(){
string evrika;
bool aniq = true;
cout << "Qidirayotgan sozinggizni kiriting : " << endl;
cin >> evrika;
for (int i = 0; i < word.size(); i++){
if (evrika == word.at(i)){
cout << word.at(i) << " - - " << mean.at(i) << endl;
aniq = false;
}
}
for (int i = 0; i < mean.size(); i++){
if (evrika == mean.at(i)){
cout << word.at(i) << " - - " << mean.at(i) << endl;
aniq = false;
}
}
if (aniq){
cout << "Lugatimizda bunday soz yoq!" << endl;
}
}
};
int main(){
Lugat l;
cout << "Lug`atga qancha soz kiritishinggizni kiriting : " << endl;
int n;
cin >> n;
l.input(n);
l.search();
return 0;
}
Natija:
Download