Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(void)
  8. {
  9. int a = 78, t1 [6], i;
  10. double b = 9.87;
  11. char c = 'W';
  12. string s;
  13.  
  14. for (i = 0; i < 6; i++)
  15. t1 [i] = 10000+i;
  16. s = "AZERTYUIO";
  17. ofstream f ("toto.txt");
  18.  
  19. if (!f.is_open())
  20. cout << "Impossible d'ouvrir le fichier en écriture !" << endl;
  21. else
  22. {
  23. f << a << " " << b << " " << c << endl;
  24. for (i = 0; i < 6; i++)
  25. f << t1 [i] << " ";
  26. f << s;
  27. }
  28. f.close();
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement