Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9.     setlocale(0, "");
  10.  
  11.     string name[100], surname[100], faculty[100], number[100] ;
  12.     int count=1, c=1;
  13.  
  14.     start:
  15.     cout << setiosflags(ios::left) << setw(15) << "Фамилия" << setw(15) << "Имя" <<  setw(20) << "Факультет" << setw(5) << "Группа" <<endl;
  16.     cout << setfill('-') << setw(56) << "-" <<endl;
  17.    
  18.     if (count == 2){
  19.         int s=c;
  20.     for (int i=0; i<=s; i++)
  21.     {
  22.     s--;
  23.     cout << setfill(' ') << setiosflags(ios::left) << setw(15) << surname[s] << setw(15) << name[s] << setw(20) << faculty[s] << setw(5) << number[s] << endl;
  24.     }
  25.     }
  26.     cout << setfill(' ') << "Выберите действие:\t1. Добавить еще студента\t2. Выход" << endl;
  27.     cin >> count;
  28.  
  29.     if (count == 1){
  30.  
  31.     cout << "Введите фамилию: ";
  32.     cin >> surname[c];
  33.     cout << "Введите имя: ";
  34.     cin >> name[c];
  35.     cout << "Введите факультет: ";
  36.     cin >> faculty[c];
  37.     cout << "Введите номер группы: ";
  38.     cin >> number[c];
  39.     c++;
  40.     count++;
  41.     system("cls");
  42.     goto start;
  43.     }
  44.  
  45.  
  46.     system ("pause");
  47.     return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement