Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. const char CDfv[] = "duom.txt";
  8. const char CDfr[] = "rez.txt";
  9. const int CAll_Male = 100;
  10. const int CAll_Famale = 100;
  11.  
  12. void Read (int boys[], int girls[], int& n);
  13.  
  14. int main()
  15. {
  16. int f_ugiai[CAll_Famale];
  17. int m_ugiai[CAll_Male];
  18. int n;
  19.  
  20. Read (m_ugiai, f_ugiai, n);
  21.  
  22. return 0;
  23. }
  24.  
  25. void Read (int boys[], int girls[], int& n)
  26. {
  27. ifstream fd(CDfv);;
  28. fd >> n;
  29. int some;
  30. for (int i = 0; i < n; i++)
  31. {
  32. fd >> some;
  33. if(some > 0) girls[i] = some;
  34. if(some < 0) boys[i] = some;
  35. cout << boys[i] << endl;
  36. }
  37. fd.close();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement