Разработка программы для создания списка и обработки данных студентов, страница 6

                                                             

work->proffs->competition==d&&!(strcmp(work->proffs->name,str1))
 


 


                                 -                                                                                  +

work=work->next,КОНЕЦ,work=work->next
count ++
,Вывод данных элемента
 


int line_find_to_SIZE_PAY_and_NAME_all (educational* begin,int value,char* str1)

work!=NULL,НАЧАЛО
 


                                                                                                         -

 


                                                             

work->proffs->size_pay==value&&!(strcmp(work->proffs->name,str1))
 


 


                                 -                                                                                  +

work=work->next,КОНЕЦ,work=work->next
count ++
,Вывод данных элемента
 



3. ЛИСТИНГ РАЗРАБОТАННОЙ ПРОГРАММЫ

#include <iostream.h>

#include <fstream.h>

#include <string.h>

#include <conio.h>

#include <stdlib.h>

//Объявление структур

struct address

{

 int post_index;    //почтовый индекс

char * city;    //город

char * street;   // улица

int  house;    // дом

};

struct profession

{

char * name;   // название специальности

char*from;    //форма обучения (очная, заочная, вечерняя и ускоренная)

double competition;  //конкурс по каждой специальности

int size_pay;   //размер оплаты

};

struct educational

{

char * division;   //вид ВУЗа

char * direction;   //направленность ВУЗа

char * name; // полное название ВУЗа

int amount;   //количество учебных специальностей

address * education;   // адрес

profession * proffs;   //перечень специальностей

educational * next;   //указатель на следующий элемент

educational * previous;  //указатель на предыдущий элемент

};

//vuvod stryktyru educational

ostream& operator << (ostream& out, educational *ed)

{

 out

  <<" division: "  <<ed-> division <<endl

  <<" direction: "  <<ed-> direction <<endl  //vuvod direction

  <<" name: " <<ed-> name <<endl

  <<" amount: "  <<ed-> amount <<endl<<endl

  <<" post_index: "  <<ed-> education -> post_index <<endl

  <<" city: "  <<ed-> education -> city <<endl

  <<" street: "  <<ed-> education -> street <<endl

  <<" house: "  <<ed-> education -> house <<endl<<endl

  <<" name: "  <<ed-> proffs -> name <<endl

  <<" form: " <<ed-> proffs -> from <<endl

  <<" competition: " <<ed-> proffs -> competition <<endl

  <<" size pay: "  <<ed-> proffs ->size_pay<<endl<<endl

    <<"*******************************************"<<endl;

return out;   //vernyt' potok

}

//ввод потока

istream& operator >> (istream& in, educational *ed)

{

 ed-> proffs =new profession;

 ed-> education =new address;

 char *str=new char [60];

 clrscr();

 cout << " VID VUSa: ";                          //vuvod division

 in >> str;                                             //vvod stroki

 ed-> division =strdup(str);    //vudelenie pamyati pod stroky

cout << " NAPRAVLENOST: ";

 in >> str;

 ed-> direction =strdup(str);

 cout << " NAME: ";

 in >> str;

 ed-> name =strdup(str);

  cout << " KOLICHESTVO SPECIALNOSTEY: ";

 in >> ed-> amount;

  cout << " POST INDEX: ";

 in >> ed-> education -> post_index;

cout << " CITY: ";

 in >> str;

 ed-> education -> city =strdup(str);