Untitled
unknown
c_cpp
2 years ago
330 B
7
Indexable
#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] << " ";
}
}
}
Editor is loading...
Leave a Comment