Advertisement
Felanpro

More with files

May 8th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     ofstream file1("players.txt");
  9.  
  10.     cout << "Enter players ID, name and money." << endl;
  11.     cout << "Press ctrl+z to quit!" << endl;
  12.  
  13.     int id;
  14.     string name;
  15.     double money;
  16.  
  17.     while(cin >> id >> name >> money)
  18.     {
  19.         file1 << id << ' ' << name << ' ' << money << endl;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement