Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // students.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include<iostream>
- using namespace std;
- struct students
- {
- char*familiya;
- char* name;
- char* otchestvo;
- char* fakultet;
- char* rabota;
- char* groshi;
- int number;
- };
- bool ravno (char* x, char* y)
- {
- bool tr = false;
- //if (strlen(x) == strlen(y))
- for (int i=0; i<strlen(x); i++)
- if (*(x+i)==*(y+i))
- tr = true;
- else return false;
- return tr;
- };
- void avto_vvid (students* st)
- {
- for (int i=0; i<20; i++)
- {
- switch (i)
- {
- case 0:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Ivanov\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Mukola\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Oleksandrovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "system programist\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="5000 grn\0";
- break;
- case 1:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Kotelnekov\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Mukuta\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Vasuliovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IAN\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "operator\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="1500 grn\0";
- break;
- case 2:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Kruvec\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Andriy\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Stanislavovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCN\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "web-duzayn\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="4000 grn\0";
- break;
- case 3:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Zinchyk\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Maksum\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Ogorovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IIDS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "ingener\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="2000 grn\0";
- break;
- case 4:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Zybenko\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Muxaulo\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Oleksandrovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "programist\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="10000 grn\0";
- break;
- case 5:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Kalkova\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Anastasia\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Mukolaivna\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "GMI\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "secretar\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="1000 grn\0";
- break;
- case 6:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Zaychyk\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Olha\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Sergiivna\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "animator\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="10000 grn\0";
- break;
- case 7:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Osmanov\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Sarxan\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Myxamad\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IIDS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "IT-texnolog\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="9000 grn\0";
- break;
- case 8:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Tonicoy\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Julia\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Volodumurivna\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "GMI\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "operator PC\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="2000 grn\0";
- break;
- case 9:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Bovsyn\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Artem\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Ilarionovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IASY\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "pilot\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="15000 grn\0";
- break;
- case 10:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Kotovuch\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Andriu\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Volodumurovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IMV\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "duplomat\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="11000 grn\0";
- break;
- case 11:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Dmutrenco\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Taras\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Dmutrovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "poligrafist\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="7000 grn\0";
- break;
- case 12:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Avramchyk\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Nina\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Oleksandrivna\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "IMV\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "perecladach\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="4000 grn\0";
- break;
- case 13:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Ilichenko\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Mukola\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Antovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FLA\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "administrator\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="3500 grn\0";
- break;
- case 14:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Solodchyk\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Olha\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Olegivna\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "FCS\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "graphichnuy animator\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="8000 grn\0";
- break;
- case 15:
- (st+i)->number=i;
- (st+i)->familiya= new char[30];
- (st+i)->familiya= "Fedin\0";
- (st+i)->name= new char[20];
- (st+i)->name= "Roman\0";
- (st+i)->otchestvo= new char[30];
- (st+i)->otchestvo= "Sergiuovuch\0";
- (st+i)->fakultet= new char[20];
- (st+i)->fakultet= "JuI\0";
- (st+i)->rabota= new char[30];
- (st+i)->rabota= "jurust\0";
- (st+i)->groshi= new char[15];
- (st+i)->groshi="9000 grn\0";
- break;
- }
- }
- }
- int poshuk_robotu (students* st, char* nm)
- {
- for (int i=0; i<16; i++)
- {
- if (ravno((st+i)->rabota, nm)==true)
- return (st+i)->number;
- }
- return -1;
- };
- void main ()
- {
- setlocale (NULL, "Rus");
- for(int i=0;i<3;i++)
- {
- students* st= new students[20];
- char* robota= new char[30];
- avto_vvid (st);
- cout<<"Ведiть професiю студента: ";
- cin>>robota;
- int counter = poshuk_robotu (st, robota);
- if (counter ==-1)
- cout<< "\n Невiрно введенi данi";
- else
- {
- cout<<endl<<"Прiзвище студента: "<<(st+counter)->familiya;
- cout<<endl<<"Iм'я студента: "<<(st+counter)->name;
- cout<<endl<<"По-батьковi: "<<(st+counter)->otchestvo;
- cout<<endl<<"Факультет: "<<(st+counter)->fakultet;
- cout<<endl<<"Заробiтна плата: "<<(st+counter)->groshi<<endl<<endl;
- }
- cout<<endl;
- }
- system ("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement