Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.  
  8. int a;
  9. cout << "a = ";
  10. cin >> a;
  11. cout << endl;
  12.  
  13. fstream f;
  14. f.open("file");
  15.  
  16. if ( f.is_open() ) {
  17.  
  18. f << a << endl;
  19.  
  20. }
  21.  
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement