Frinom

lab10/print

Nov 11th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. #include "stdafx.h"
  2. using namespace std;
  3. void print(Dictionary *dict, const int &emptyArr, const int &mode)
  4. {
  5.     system("cls");
  6.     cout << fixed << left << setw(32)
  7.         << "Английское слово               "
  8.         << " "
  9.         << "Русское слово" << endl;
  10.     for (int i = 0; i < emptyArr; i++)
  11.     {
  12.         int j = 0;
  13.         cout << fixed << left;
  14.         while (dict[i].engl[j] != '\0')
  15.         {
  16.             cout << dict[i].engl[j];
  17.             j++;
  18.         }
  19.         j = 0;
  20.         cout << setw(33 - length(dict[i].engl)) << " " << fixed << left;
  21.         while (dict[i].rus[j] != '\0')
  22.         {
  23.             cout << dict[i].rus[j];
  24.             j++;
  25.         }
  26.         cout << endl;
  27.     }
  28.     cout << endl;
  29.     if (mode > 0)
  30.     {
  31.         cout << "Для продолжения введите любой символ" << endl;
  32.         char str[10];
  33.         cin >> str;
  34.     }
  35. }
  36.  
  37. char menu()
  38. {
  39.     char way;
  40.     cout << "\t\t Меню словаря" << endl;
  41.     cout << "1) добавление слов в словарь; " << endl;
  42.     cout << "2) удаление слов из словаря; " << endl;
  43.     cout << "3) перевод слов с английского на русский; " << endl;
  44.     cout << "4) перевод слов с русского на английский; " << endl;
  45.     cout << "5) просмотр словаря (вывод на экран словаря из ОП); " << endl;
  46.     cout << "6) вывод словаря в файл; " << endl;
  47.     cout << "7) выход. " << endl;
  48.     cin >> way;
  49.     return way;
  50. }
Add Comment
Please, Sign In to add comment