Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
356 B
0
Indexable
Never
#include <iostream>
#include <fstream>

using namespace std;

int foo(int x) {
	int y;
	y = x ^ 2 + 5 * x - 4;
	return y;
}

int main()
{
	ofstream oleg("stim.txt");
	int n, a, d;
	cin >> n >> a >> d;
	int x = a;
	for (int i = 0; i < n; i++, x += d)
	{
		oleg << "x = " << x << " ";
		foo(x);
		oleg << "y = " << foo(x) << endl;
	}
}
Leave a Comment