Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "iostream"
- #include "string"
- #include <set>
- #include <algorithm>
- using namespace std;
- class student {
- public:
- student() {
- a = 0;
- fio = "Kolesnikov Vadim Sergeevich";
- vuz = "PSU";
- fac = "Facultet";
- kaf = "Kafedra";
- f_o = "OchkaZaochka";
- }
- student(char *fio1, int a1) {
- a = a1;
- fio = fio1;
- vuz = "VUZ";
- fac = "Facultet";
- kaf = "Kafedra";
- f_o = "OchkaZaochka";
- }
- ~student() {};
- void output() {
- cout << fio.c_str() << endl;
- cout << vuz.c_str() << endl;
- cout << fac.c_str() << endl;
- cout << kaf.c_str() << endl;
- cout << f_o.c_str() << endl << endl;
- }
- void input() {
- cout << "FIO:";
- cin >> fio;
- cout << "vuz:";
- cin >> vuz;
- cout << "fac:";
- cin >> fac;
- cout << "kaf:";
- cin >> kaf;
- cout << "f_o:";
- cin >> f_o;
- cout << endl;
- }
- protected:
- string kaf;
- string f_o;
- int a;
- private:
- string fio;
- string vuz;
- string fac;
- };
- bool operator< (student &ob1, student &ob2) {
- return true;
- }
- void main(void)
- {
- char str0[] = "Potogin Nikita";
- char str1[] = "Sidelnikov Maxim";
- char str2[] = "Kolesnikov Vadim";
- char str3[] = "Fedoseev Gena";
- student ob0(str0,1);
- student ob1(str1,2);
- student ob2(str2,3);
- student ob3(str3,4);
- ob0.output();
- multiset<student> list;
- multiset<student>::iterator it;
- list.insert(ob0);
- list.insert(ob1);
- list.insert(ob2);
- list.insert(ob3);
- system("pause");
- }
Add Comment
Please, Sign In to add comment