using namespace std; int main(){ int n;cout<<"n=";cin>>n; struct Guruh{
string fio,adres; }talaba[n]; for(int i=0;i
}
if (key < talaba[mid].adres) hi = mid - 1; else low = mid + 1;
} if(search!=-1) cout<<"qidirilayotgan el "<
}
while(talaba[search-1].adres==key) search--; while(talaba[search].adres==key) { cout<
"<
search++;
} system("pause");
}
Dastur natijasi:
n=5
1-talabaning fio=fam1 adres=Toshkent 2-talabaning fio=fam2 adres=TTJ
3-talabaning fio=fam3 adres=ijarada 4-talabaning fio=fam4 adres=uchastkada 5-talabaning fio=fam5 adres=TTJ fam2 TTJ fam5 TTJ fam1 Toshkent fam3 ijarada fam4 uchastkada qidirilayotgan el 1-orinda turubdi va 2 ta solishtirishda topildi fam2 TTJ fam5 TTJ