Norvager

http://lerna.pro/contests/157/7

Oct 27th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <string>
  6. using namespace std;
  7. struct moniker {
  8. string name;
  9. bool gen;
  10. };
  11.  
  12. vector <moniker> nominal;
  13. vector <pair <string, string>> type;
  14. vector <vector <pair <string, string>>> rel;
  15.  
  16. void Com_And_Fill(string n1, string rap, string n2)
  17. {
  18. int ind;
  19. for (int i = 0; i < nominal.size(); i++)
  20. {
  21. if (n1 == nominal[i].name)
  22. {
  23. ind = i;
  24. }
  25. }
  26. }
  27.  
  28. int main()
  29. {
  30. type.push_back(make_pair("Husband", "Wife"));//0
  31. type.push_back(make_pair("Father", "Mother"));//1
  32. type.push_back(make_pair("Son", "Daughter"));//2
  33. type.push_back(make_pair("Brother", "Sister"));//3
  34. type.push_back(make_pair("Grandfather", "Grandmother"));//4
  35. type.push_back(make_pair("Grandson", "Granddaughter"));//5
  36. type.push_back(make_pair("Nephew", "Niece"));//6
  37. type.push_back(make_pair("Uncle", "Aunt"));//7
  38. type.push_back(make_pair("Son_In_Law", "Daughter_In_Law"));//8
  39. type.push_back(make_pair("Mother_In_Law_From_Wife", "Father_In_Law_From_Wife"));//9
  40. type.push_back(make_pair("Father_In_Law_From_Husband", "Mother_In_Law_From_Husband"));//10
  41. int N;
  42. scanf("%d", &N);
  43. nominal.resize(N);
  44. string a, b, c;
  45. for (int i = 0; i < N; ++i)
  46. {
  47. cin >> nominal[i].name >> a;
  48. if (a[0] = 'M')
  49. nominal[i].gen = true;
  50. else nominal[i].gen = false;
  51. }
  52. int M;
  53. scanf("%d", &M);
  54. for (int i = 0; i < M; ++i)
  55. {
  56. cin >> a >> b >> c;
  57. Com_And_Fill(a, b, c);
  58. }
  59. return 0;
  60. }
Add Comment
Please, Sign In to add comment