Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- int main ()
- {
- int n, i = 1;
- std::cout <<"Enter number: "<<std::flush;
- std::cin >> n;
- std::ofstream f("filename.txt");
- while (i != n)
- {
- f << i <<std::endl;
- i++;
- }
- f.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement