Untitled
unknown
plain_text
2 years ago
242 B
3
Indexable
Never
#include <iostream> using namespace std; int main() { int A1, A2, d, n; cin >> A1 >> A2; cout << "Input n: "; cin >> n; d = A2 - A1; A1 = A2; for (int i = 0; i < n - 2; i++) { A1 = A2; A2 = A1 + d; cout << A2 << " "; } }