Untitled
Anonymous
plain_text
02/22/2024 6:06 PM
408 B
13
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