Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream>
  3. #include <cstdio>
  4.  
  5. using namespace std;
  6. struct ZNAK {
  7.     string Fam;
  8.     int Data[3];
  9.     string Znak;
  10. };
  11.  
  12. ZNAK Z[8];
  13.  
  14. int main()
  15. {
  16.     int month;
  17.     setlocale(LC_ALL, "Russian");
  18.     for (int i = 0; i < 7; i++) {
  19.         cout << "Введите Фамилию:";
  20.         cin >> Z[i].Fam;
  21.         cout << "Введите день рождения:";
  22.         cin >> Z[i].Data[1];
  23.         cout << "Введите месяц рождения:";
  24.         cin >> Z[i].Data[2];
  25.         cout << "Введите год рождения:";
  26.         cin >> Z[i].Data[3];
  27.         cout << "Введите Знак зодиака:";
  28.         cin >> Z[i].Znak;
  29.         cout << endl;
  30.     }
  31.  
  32.     cout << "Введите месяц: ";
  33.     cin >> month;
  34.  
  35.     for (int i = 0; i < 8; i++)
  36.     {
  37.         if (month == Z[i].Data[2]) {
  38.             cout << "Фамилия: " << "Дата рождения: " << Z[i].Data[1] << "." << Z[i].Data[2] << "." << Z[i].Data[3] << "Знак зодиака: " << Z[i].Znak;
  39.         }
  40.     }
  41.    
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement