Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include <conio.h>
- #include<iostream>
- #include <stdio.h>
- #include<iomanip>
- void menushka ();
- void Consl_vyvod_info ();
- struct gruppa;
- struct student;
- gruppa *Top, *new_gr, *actual_gr;
- student *top_st, *new_st, *actual_st;
- int ns,ng;
- using namespace std;
- struct gruppa
- {
- int Nomer_Gruppy;
- int kolichestvo_studentov;
- gruppa *next;
- student *st;
- };
- struct student
- {
- char FIO[50];
- int nomer_studenta;
- int sessiy[5];
- float stependiy;
- char bydzhet_kontrakt[2];
- student *next1;
- student *t;
- };
- void menushka ()
- {
- ifstream strm("./menu.txt");
- char ss[255] = {0};
- while(true)
- {
- strm.getline(ss, 255);
- if (strm.eof()) break;
- cout << ss << "\n";
- }
- }
- void Consl_Vvod_info () //Консольный Ввод информации
- {
- Top=new gruppa;
- actual_gr=Top;
- cout<<"Введите номер группы"<<endl;
- cin>>actual_gr->Nomer_Gruppy;
- while(true)
- {
- top_st = new student;
- actual_st = top_st;
- actual_gr->st=actual_st;
- cout<<"Введите номер студента"<<endl;
- cin>>actual_st->nomer_studenta;
- cout<<"Введите ФИО студента"<<endl;
- cin>>actual_st->FIO;
- cout<<"Введите 5 оценок за сессию"<<endl;
- for(int i=0;i<5;i++)
- cin>>actual_st->sessiy[i];
- cout<<"Введите размер степендии"<<endl;
- cin>>actual_st->stependiy;
- cout<< "Бюджетник(B) или контрактник(K)"<<endl;
- cin>>actual_st->bydzhet_kontrakt;
- actual_gr->kolichestvo_studentov=1;
- while(true)
- {
- cout<<"Введите номер студента"<<endl;
- cin>>ns;
- if (ns==0)
- {
- actual_st->next1 = NULL;
- break;
- }
- new_st = new student;
- actual_st->next1 = new_st;
- actual_st = new_st;
- actual_st->nomer_studenta=ns;
- cout<<"Введите ФИО студента";
- cin>>actual_st->FIO;
- cout<<"Введите 5 оценок за сессию"<<endl;
- for(int i=0;i<5;i++)
- cin>>actual_st->sessiy[i];
- cout<<"Введите размер степендии"<<endl;
- cin>>actual_st->stependiy;
- cout<< "Бюджетник(B) или контрактник(K)"<<endl;
- cin>>actual_st->bydzhet_kontrakt;
- actual_gr->kolichestvo_studentov++;
- }
- cout<<"Введите номер группы"<<endl;
- cin>>ng;
- if (ng==0)
- {
- actual_gr->next = NULL;
- break;
- }
- new_gr=new gruppa;
- actual_gr->next=new_gr;
- actual_gr=new_gr;
- actual_gr->Nomer_Gruppy=ng;
- }
- }
- void Consl_vyvod_info () //Консольный вывод Информации
- {
- actual_gr=Top;
- while (actual_gr)
- {
- cout<<"Номер группы__Количество студентов"<<endl;
- cout<<actual_gr->Nomer_Gruppy<<" "<<actual_gr->kolichestvo_studentov<<endl;
- cout<<"Фио__Оценки за сессию__Размер степендии__Бюджет/Контракт"<<endl;
- while (actual_gr->st)
- {
- cout<<actual_gr->st->FIO<<" ";
- for(int i=0;i<5;i++) cout<<actual_gr->st->sessiy[i]<<" ";
- cout<<actual_gr->st->stependiy<<" "<<actual_gr->st->bydzhet_kontrakt<<endl;
- new_st=actual_gr->st->next1;
- actual_gr->st=new_st;
- }
- actual_gr=actual_gr->next;
- }
- }
- int main ()
- {
- setlocale (LC_ALL, "RUS");
- int input;
- while (1)
- {
- menushka();
- cin>>input;
- switch (input)
- {
- case 1:
- Consl_Vvod_info ();
- system("cls");
- break;
- case 2:
- Consl_vyvod_info ();
- break;
- }
- }
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement