Untitled
unknown
c_cpp
2 years ago
532 B
7
Indexable
#include <iostream>
#include <fstream>
using namespace std;
void func(int n, int a, int d, ofstream &fout) {
int y;
for (int i = a; i < a + n; i += d) {
y = (i * i) + (5 * i) - 4;
fout << "x = " << i << ", y = " << y << endl;
}
}
int main() {
setlocale(LC_ALL, "Russian");
ofstream fout("func.txt");
int n, a, d;
cout << "Количество точек: ";
cin >> n;
cout << "Начальная точка: ";
cin >> a;
cout << "Смещение по: ";
cin >> d;
func(n, a, d,fout);
}Editor is loading...
Leave a Comment