Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Online C++ Compiler.
  4. Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10. #include <fstream>
  11.  
  12. using namespace std;
  13.  
  14.  
  15. int writeFile (string data)
  16. {
  17. ofstream myfile;
  18. myfile.open("test.txt");
  19. myfile << "TWOJE IMIĘ I NAZWISKO TO: " << data;
  20. myfile.close();
  21. return 0;
  22. }
  23.  
  24. int main()
  25. {
  26.  
  27. string a, b;
  28. cout<< "Podaj imie" << endl;
  29. cin >> a;
  30. cout << "Nazwisko" << endl;
  31. cin >> b;
  32.  
  33.  
  34.  
  35. cout << a + b;
  36. writeFile(a + " " + b);
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement