Untitled

 avatar
unknown
plain_text
2 years ago
340 B
3
Indexable
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int foo(int x) {
	int g;
	g = x * x + 5 * x;
	return g;
}
int main() {
	int a;
	cin >> a;
	vector <int> n;
	for (int i = 0; i < a+1; i++){
		n.push_back(foo(i));
	}
	for (int i = 0; i < a; i++){
		cout << n[i] << ' ';
	}
}
Editor is loading...