Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int num1;
  8. int num2;
  9. int num3;
  10. int num4;
  11. int num5;
  12. int num6;
  13.  
  14. cout << "The values are in the file: " << endl;
  15. cin >> num1;
  16. cin >> num2;
  17. cin >> num3;
  18. cin >> num4;
  19. cin >> num5;
  20. cin >> num6;
  21.  
  22. ofstream outfile;
  23. outfile.open("data.txt");
  24. outfile << num1;
  25. outfile << num2;
  26. outfile << num3;
  27. outfile << num4;
  28. outfile << num5;
  29. outfile << num6;
  30. outfile.close();
  31.  
  32. cout << endl;
  33. system("pause");
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement