Guest User

Untitled

a guest
Feb 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include "string"
  4. #include <set>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. class student {
  10. public:
  11. student() {
  12. a = 0;
  13. fio = "Kolesnikov Vadim Sergeevich";
  14. vuz = "PSU";
  15. fac = "Facultet";
  16. kaf = "Kafedra";
  17. f_o = "OchkaZaochka";
  18. }
  19. student(char *fio1, int a1) {
  20. a = a1;
  21. fio = fio1;
  22. vuz = "VUZ";
  23. fac = "Facultet";
  24. kaf = "Kafedra";
  25. f_o = "OchkaZaochka";
  26. }
  27. ~student() {};
  28. void output() {
  29. cout << fio.c_str() << endl;
  30. cout << vuz.c_str() << endl;
  31. cout << fac.c_str() << endl;
  32. cout << kaf.c_str() << endl;
  33. cout << f_o.c_str() << endl << endl;
  34. }
  35. void input() {
  36. cout << "FIO:";
  37. cin >> fio;
  38. cout << "vuz:";
  39. cin >> vuz;
  40. cout << "fac:";
  41. cin >> fac;
  42. cout << "kaf:";
  43. cin >> kaf;
  44. cout << "f_o:";
  45. cin >> f_o;
  46. cout << endl;
  47. }
  48. protected:
  49. string kaf;
  50. string f_o;
  51. int a;
  52. private:
  53. string fio;
  54. string vuz;
  55. string fac;
  56. };
  57.  
  58. bool operator< (student &ob1, student &ob2) {
  59. return true;
  60. }
  61.  
  62. void main(void)
  63. {
  64. char str0[] = "Potogin Nikita";
  65. char str1[] = "Sidelnikov Maxim";
  66. char str2[] = "Kolesnikov Vadim";
  67. char str3[] = "Fedoseev Gena";
  68. student ob0(str0,1);
  69. student ob1(str1,2);
  70. student ob2(str2,3);
  71. student ob3(str3,4);
  72. ob0.output();
  73.  
  74. multiset<student> list;
  75. multiset<student>::iterator it;
  76. list.insert(ob0);
  77. list.insert(ob1);
  78. list.insert(ob2);
  79. list.insert(ob3);
  80.  
  81. system("pause");
  82. }
Add Comment
Please, Sign In to add comment