Untitled
unknown
c_cpp
2 years ago
472 B
9
Indexable
using namespace std;
#include <iostream>
#include <iostream>
#include <stdio.h>
#include <string>
#include <ctime>
#include <fstream>
int y(int x) {
int y;
y = x * x + 5 * x - 4;
return y;
}
int main()
{
ofstream out("amogus.txt");
int n, a, d;
cin >> n >> a >> d;
int x = a;
for (int i = 0; i < n;i++, x+=d)
{
out <<"x = "<< x << "\n";
out <<"y = " << y(x) << "\n";
}
}
Editor is loading...
Leave a Comment