Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include<iomanip>
  4. #include<fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. float x, y, g, k;
  10. ifstream in_stream;
  11. in_stream.open("input.txt");
  12. ofstream out_stream;
  13. out_stream.open("output.txt");
  14.  
  15. in_stream >> x;
  16. g = x;
  17.  
  18. out_stream.setf(ios::fixed);
  19. out_stream.setf(ios::showpoint);
  20. out_stream.precision(2);
  21.  
  22. while (!in_stream.eof()) {
  23. in_stream >> y;
  24. if (y != g) {
  25. k = y / g;
  26. out_stream << setw(9) << k << endl;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement