Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include<sstream>
- #include <ctype.h>
- #include<cctype>
- #include<list>
- #include <vector>
- using namespace std;
- struct Mystruct
- {
- string city;
- string institute;
- string faculty;
- vector<string> tm;
- vector<vector<string>> listOfSpecialties;
- string planOfAdmissionToTheFirstYear;
- int passingScore;
- } MystructArr[2];
- using namespace std;
- int main()
- {
- setlocale(0, "");
- int i;
- for (i = 0; i < 2; i++)
- {
- MystructArr[0].city = "Київ";
- MystructArr[1].city = "Вінниця";
- MystructArr[i].faculty = "Право";
- MystructArr[0].institute = "Політехнічний";
- MystructArr[1].institute = "НУБіП";
- for (int f = 0; f < 2; f++) {
- MystructArr[0].tm.push_back("Програмування");
- MystructArr[0].listOfSpecialties.push_back(MystructArr[0].tm);
- }
- MystructArr[i].planOfAdmissionToTheFirstYear = "____";
- MystructArr[i].passingScore = 10 + (i + 1);
- }
- for (i = 0; i < 2; i++)
- {
- cout << MystructArr[i].city << endl;
- cout << MystructArr[i].faculty << endl;
- cout << MystructArr[i].institute << endl;
- for (int f = 0; f < MystructArr[i].listOfSpecialties.size(); f++)
- {
- cout << MystructArr[i].listOfSpecialties[f] << endl;
- }
- cout << MystructArr[i].planOfAdmissionToTheFirstYear << endl;
- cout << MystructArr[i].passingScore << endl;
- }
- for (i = 0; i < 2; i++)
- {
- if (MystructArr[i].institute == "Політехнічний")
- cout << MystructArr[i].city << endl;
- }
- cout << "нститути і факультети, де приймають студентів на перший курс за заданою користувачем спеціальністю\n";
- for (i = 0; i < 2; i++)
- {
- for (int f = 0; f < MystructArr[i].listOfSpecialties.size(); f++)
- {
- if (MystructArr[i].listOfSpecialties[f] == "Програмування")
- {
- cout << MystructArr[i].faculty << endl;
- cout << MystructArr[i].institute << endl;
- cout << MystructArr[i].city << endl;
- }
- }
- }
- std::cout << "///\n";
- int max = -1;
- for (int i = 0; i < 2; i++)
- {
- for (int f = 0; f < MystructArr[i].listOfSpecialties.size(); f++)
- {
- if (MystructArr[i].listOfSpecialties[f] == "Програмування")
- {
- if (max < MystructArr[i].passingScore)
- max = MystructArr[i].passingScore;
- }
- }
- }
- cout << "\nфакультет, інститут і місто, де на вказану користувачем спеціальність існує найвищий прохідний бал" << endl;
- for (int i = 0; i < 2; i++)
- {
- if (MystructArr[i].passingScore == max)
- {
- std::cout << MystructArr[i].faculty << "\n";
- std::cout << MystructArr[i].institute << "\n";
- std::cout << MystructArr[i].city << "\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment