Advertisement
Courbe_Impliquee

struct2

Sep 7th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <iostream>
  2. #include "stdafx.h"
  3.  
  4. using namespace std;
  5. struct FIO{
  6. char name[30];
  7. char surname[30];
  8. char patronymic[30];
  9. };
  10. struct Student{
  11. FIO fio;
  12. int group;
  13. int exams;
  14. char discipline[7];
  15. int mark;
  16. };
  17. void output_info(Student *A, int n){
  18. for (int i = 0; i<n; i++)
  19. {
  20. cout << A[i].fio.name << endl;
  21. cout << A[i].fio.surname << endl;
  22. cout << A[i].fio.patronymic << endl;
  23. cout << A[i].group << endl;
  24. cout << A[i].mark << endl;
  25. cout << A[i].discipline << endl;
  26. }
  27. }
  28. void get_info(Student *A, int n){
  29. for (int i = 0; i < n; i++){
  30. cout << endl;
  31. cout << "ФИО";
  32. cin.getline(A[i].fio.name, 30);
  33. cin.getline(A[i].fio.surname, 30);
  34. cin.getline(A[i].fio.patronymic, 30);
  35.  
  36. cout << endl;
  37. cout << "Число экзаменов";
  38. cin >> A[i].exams;
  39.  
  40. cout << endl;
  41. cout << "Названия дисциплин";
  42. cin.getline(A[i].discipline, 30);
  43.  
  44. cout << endl;
  45. cout << "Оценки";
  46. cin >> A[i].mark;
  47.  
  48. cout << endl;
  49. cout << "Группа";
  50. cin >> A[i].group;
  51. }
  52. }
  53. int _tmain(int argc, _TCHAR* argv[]){
  54. int n;
  55. cout << "Введите n";
  56. cin >> n;
  57. Student*A = new Student[n];
  58. get_info(A, n);
  59. output_info(A, n);
  60. Student disp[7];
  61. for (int i = 0; i < 7; i++){
  62. cin.getline(disp[i].discipline,30);
  63. }
  64. Student MARK[7];
  65. for (int i = 0; i < 7; i++){
  66. cin >> MARK[i].mark;
  67. }
  68. return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement