Advertisement
3axap_010

main.cpp

Jun 6th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.22 KB | None | 0 0
  1. // lab4_sem.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
  2. //
  3.  
  4. #include "pch.h"
  5. #include "Header.h"
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <locale.h>
  10.  
  11. int main()
  12. {
  13.     setlocale(LC_ALL, "Russian");
  14.  
  15.     struct connection *conn = make_connection("file", "w+b");
  16.    
  17.     int students_number = set_all(conn);
  18.  
  19.     system("CLS");
  20.     print_all(conn->classes, students_number);
  21.  
  22.     write(conn);
  23.  
  24.     conn = delete_connection(conn);
  25.  
  26.     conn = read(conn);
  27.  
  28.     printf("После считывания из файла:\n");
  29.     print_all(conn->classes, MAX_ROWS);
  30.  
  31.     float average = get_average(conn->classes);
  32.     printf("Общий средний балл: %f\n", average);
  33.  
  34.     int good_students = print_good(conn->classes);
  35.  
  36.     struct clas *best_students = find_best(conn->classes, students_number);
  37.  
  38.     print_best(best_students);
  39.  
  40.     sort(conn->classes);
  41.     printf("После сортировки по алфавиту:\n\n");
  42.     print_all(conn->classes, MAX_ROWS);
  43.  
  44.     struct student *stud = read_n(conn);
  45.     print_student(stud);
  46.  
  47.     free(best_students);
  48.     conn = delete_connection(conn);
  49.  
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement