Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
371 B
1
Indexable
Never
#include <iostream>
#include <fstream>
using namespace std;
void y(int x, int b, int c, ofstream &file) {
    int y = 0;
    while (x < 11) {
    y = x * x + 5 * x - 4;
    file << x << ' ' << y;
    x += c;
    cout << y << "\n";
    }
}
int main(){
    int b, c;
    cin >> b >> c;
    int x = b;
    ofstream file("y(x).txt");
    y(x, b, c, file);
}
Leave a Comment