Advertisement
Guest User

Untitled

a guest
May 20th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. #include "student.h"
  2. #include <iostream>
  3. #include <Windows.h>
  4. using namespace std;
  5. int main() {
  6. int n,b;
  7. SetConsoleCP(1251);
  8. SetConsoleOutputCP(1251);
  9. cout << "Введите количество студентов: "; cin >> n;
  10. student *d = new student[n];
  11. do {
  12. system("cls");
  13. cout << "====================" << endl;
  14. cout << " 1.Ввод данных " << endl;
  15. cout << " 2.Вывод данных " << endl;
  16. cout << " 3.Старший студент " << endl;
  17. cout << " 4.Выход " << endl;
  18. cout << "====================" << endl;
  19. cin >> b;
  20. switch (b) {
  21. case 1: {
  22. for (int i(0); i < n; i++) {
  23. system("cls");
  24. cout << "Студент №" << i + 1 << endl << endl;
  25. cout << "Введите ФИО студента: ";
  26. student::input_name(d,i);
  27. cout << "Введите возраст студента: ";
  28. student::input_age(d, i);
  29. cout << "Введите курс студента: ";
  30. student::input_StudYear(d, i);
  31. cout << "Введите оценку студента по 3 предметам(через пробел): ";
  32. student::input_grade(d, i);
  33. }
  34. }; break;
  35. case 2: {
  36. if (student::check_empty(d)) {
  37. cout << "Список пуст..." << endl;
  38. system("pause");
  39. }
  40. else {
  41. for(int i(0);i<n;i++)
  42. cout << student::show_name(d, i)<<"("<<student::show_age(d,i)<<") ["<<student::show_StudYear(d,i)<<"] Балл:"<<student::show_grade(d,i)<<endl;
  43. system("pause");
  44. }
  45. }; break;
  46. case 3: {
  47. if (student::check_empty(d)) {
  48. cout << "Список пуст..." << endl;
  49. system("pause");
  50. }
  51. else {
  52. cout << "Введите номер курса:"; int g; cin >> g;
  53. cout << student::SarodipSatra(d, n, g);
  54. system("pause");
  55. }
  56. }; break;
  57. case 4:exit(0);
  58. default:cout << "Неправильный ввод!" << endl;
  59. }
  60. } while (0==0);
  61. return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement