Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
312 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main() {
	int a, b, c, d;
	int mas[1000];
	cin >> a;
	for (int i = 0; i < a; i++) {
		cin >> mas[i];
	}
	cin >> b;
	for (int i = 0; i < b; i++){
		cin >> c >> d;
		for (int j = c; j < d+1; j++) {
			cout << mas[j - 1] << ' ';
		}
		cout << endl;
	}
}