Untitled
unknown
c_cpp
2 years ago
382 B
3
Indexable
#include <iostream> int main() { int n; std::cin >> n; int num[20]{ 0 }; for (int i = 0; i < n; i++) { std::cin >> num[i]; } int t, a, b; std::cin >> t; for (int i = 0; i < t; i++) { std::cin >> a >> b; for (a -= 1; a < b; a++) { std::cout << num[a] << " "; }std::cout << "\n"; } }
Editor is loading...
Leave a Comment