Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
322 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	short int n;
	cin >> n;
	int mas[20];
	for (int i = 0; i < n; i++) {
		cin >> mas[i];
	}
	int t;
	cin >> t;
	int a, b;
	for (t; t > 0; t--)
	{
		cin >> a >> b;
		while (a - 1 < b)
		{
			cout << mas[a- 1] << "\n";
			a++;
		}
	}
    return 0;
}
Leave a Comment