Untitled

 avatar
unknown
plain_text
a year ago
306 B
3
Indexable
#include <iostream>
#include <fstream>
using namespace std;

void y(ofstream &file, int n) {
    int i = 1;
    while (i <= n) {
        file << i << "  ";
        cout << i << "  ";
        i++;
    }
}
int main(){
    int n;
    cin >> n;
    ofstream file("y(x).txt");
    y(file, n);
}
Editor is loading...
Leave a Comment