Advertisement
a53

R10

a53
Oct 20th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <fstream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,k;
  8. ifstream f("r10.in");
  9. f>>n>>k;
  10. n/=k;
  11. double a[k];
  12. ofstream g("r10.out");
  13. for(int j=0;j<n;++j)
  14. {
  15. for(int i=0;i<k;++i)
  16. f>>a[i];
  17. sort(a,a+k);
  18. for(int i=0;i<k;++i)
  19. g<<a[i]<<' ';
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement