ofstream amlak_file("amlak.txt");
long number;
string name,mahal,address;
cout<<"inter your number ,name , mahal amlak and address(inter 0 for quit va number ra bedone sefr vared konid)"<<endl;
for( ; ; ){
cout<<"number = ";
cin>>number;
if(number == 0)
break;
cout<<"name = ";
cin>>name;
cout<<"makan = ";
cin>>mahal;
cout<<"address = ";
cin>>address;
amlak_file<<' '<<number<<' '<<name<<' '<<mahal<<' '<<address;

}

*/
ifstream amlak_file("amlak.txt");
long number;
string name,search_name,mahal,address;

bool found = false;
cout<<"Enter a name for finding its number , amlak and address "<<endl;
cout<<"name = ";
cin>>search_name;
cout<<endl;

while(amlak_file>>number){
amlak_file>> name ;
amlak_file>> address ;
amlak_file>> mahal ;
if(name == search_name){
cout<<search_name<<" number = "<<number<<", mahal = "<<mahal<<", address = "<<address<<endl;
found = true;
break;
}

}

if(found == false){
cout<<search_name<<" is not in this notebook"<<endl;
}



return 0;
}


سلام این سورس من برای مشاور املاکه برای وارد کردن اطلاعات قسمت دووم رو کامنت کنید و قسمت اول رو اجرا کنید و برای جستجوی اطلاعات وارد شده قسمت اول رو کامنت و قسمت دووم رو اجرا کنید امیدوارم بدردتو بخورهایمیل بنده:
alizadehabolfazl350@gmail.com