Guest User

Untitled

a guest
Apr 23rd, 2019
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<string>
  3. #include<fstream>
  4. using namespace std;
  5. ifstream pes("input.txt");
  6. ofstream sep("output.txt");
  7. struct student
  8. {
  9. string Last_name, First_name, Second_name;
  10. int gr;
  11. int otc[5];
  12. int key = 0;
  13. };
  14. void puzir(student *lox, int n)
  15. {
  16. student temp;
  17. int i, j;
  18. for (i = 0; i < n - 1; i++)
  19. for (j = n - 1; j > i; j--)
  20. if (lox[j].key < lox[j - 1].key)
  21. {
  22. temp = lox[i];
  23. lox[j] = lox[j - 1];
  24. lox[j - 1] = temp;
  25. }
  26. }
  27. int main()
  28. {
  29. int n;
  30. student lox[3];
  31. while (pes.peek() != EOF)
  32. {
  33. pes >> lox->Last_name;
  34. pes >> lox->First_name;
  35. pes >> lox->Second_name;
  36. pes >> lox->gr;
  37. for (int i = 0; i < 5; i++)
  38. pes >> lox->otc[i];
  39. }
  40. /*for (int i = 0; i < 3; i++)
  41. puzir(lox, 3);*/
  42. //system("pause");
  43. return 0;
  44. }
RAW Paste Data