fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n, i, j, k;
  7. int tab[1000];
  8. cin >> n;
  9. for(int i=0;i<n;i++) {
  10. cin >> tab[i];
  11. }
  12. cin >> i >> j >> k;
  13. cout << tab[i-1] << " " << tab[j-1] << " " << tab[k-1] << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 5280KB
stdin
5
2 3 7 8 1
2 4 1
stdout
3 8 2