Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
480 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main() {
	setlocale(LC_ALL, "Russian");
	int n, t, mas[20], a, p1, p2;
	cout << "Введите количество чисел: ";
	cin >> n;
	cout << "Введите числа: " << endl;
	for (int i = 0; i < n; i++) {
		cin >> a;
		mas[i] = a;
	}
	cout << "Введите t: " << endl;
	cin >> t;
	p1 = t;
	cin >> t;
	p2 = t;
	cout << endl;
	for (int i = p1 - 1; i < p2; i++) {
		cout << mas[i] << endl;
	}
}
Leave a Comment