Advertisement
seld1

Untitled

Mar 20th, 2021
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. enum Sex
  4. {
  5.     Male,
  6.     Female,
  7. };
  8.  
  9.  
  10. struct Worker {
  11.     bool Education;
  12.     union {
  13.         struct {
  14.             string fio; //ФИО
  15.             string post;//Должность
  16.             int  experience;//Стаж
  17.             Sex sex;
  18.             string title;
  19.             string special;
  20.         } InfoUseEdu;
  21.         struct {
  22.             string fio; //ФИО
  23.             string post;//Должность
  24.             int  experience;//Стаж
  25.             Sex sex;
  26.         } InfoNoEdu;
  27.  
  28.     }info;
  29. } w1, w2, w3;
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. int main()
  37. {
  38.    
  39.    
  40.    
  41.     w1.info.InfoUseEdu.fio = "Мурзак Даниил Сергеввич";
  42.     w1.info.InfoUseEdu.sex = Male,
  43.     w1.info.InfoUseEdu.post = "Junior developer";
  44.     w1.info.InfoUseEdu.experience = 1;
  45.     w1.Education = true;
  46.     w1.info.InfoUseEdu.special = "Прикладная информатика в здравоохранении";
  47.     w1.info.InfoUseEdu.title = "ТГПУ. им. л.н Толстого ";
  48.  
  49.  
  50.     w2.info.InfoUseEdu.fio = "Малинин Геннадий Валеревич";
  51.     w2.info.InfoUseEdu.sex = Male,
  52.     w2.info.InfoUseEdu.post = "Middle developer";
  53.     w2.info.InfoUseEdu.experience = 5;
  54.     w2.Education = true;
  55.     w2.info.InfoUseEdu.special = "Прикладная информатика в здравоохранении";
  56.     w2.info.InfoUseEdu.title = "ТГПУ. им. л.н Толстого ";
  57.  
  58.     w3.info.InfoNoEdu.fio = "Голубина Светлана Анатольевна";
  59.     w3.info.InfoNoEdu.sex = Female,
  60.         w3.info.InfoNoEdu.post = "Секретарь";
  61.     w3.info.InfoNoEdu.experience = 2;
  62.     w3.Education = false;
  63.  
  64.        
  65.        
  66.    
  67.    
  68. }
  69.  
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement