Untitled

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

int main() {
	int n;
	int mas[20];
	cin >> n;
	for (int i = 0; i < n; i++) {
		int p;
		cin >> p;
		mas[i] = p;
	}
	
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		int a,b;
		cin >> a >> b;
		for (int i = 0; a <= b; a++) {
			cout << mas[a-1] << " ";
		}
	}
}
Leave a Comment