include iostream include fstream include string include stdlib using n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main()
{
while(1){
cout << "VVedite familiu or end" << endl; cin>>name;
if (strcmp(name,"end")==0)break;
bool not_found=true;
for (i=0;i<n_record;i++){
if (strstr(dbase[i].name,name))
if (dbase[i].name[strlen(name)]==' '){
strcpy(name,dbase[i].name);
cout<<name<<dbase[i].birth_year<<' '<<dbase[i].pay<<endl;
n_man++; mean_pay+=dbase[i].pay;
not_found=false;
}
}
if (not_found) cout<<"TAKOGO NET"<<endl;
}
if (n_man>0)cout<<"Sredniy_oklad:"<<mean_pay/n_man<<endl;
return 0;
}