fork download
  1. //@Author Damien Bell
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9. int arrayXY[5]= {50,100,150,200,279};
  10. vector<int> vecXY;
  11.  
  12. for (int i=4; i >= 0; i--){
  13. vecXY.push_back(arrayXY[i]);
  14. }
  15.  
  16. for (int i=0; i < vecXY.size(); i++){
  17. cout <<vecXY[i]<<endl;
  18. }
  19.  
  20.  
  21. return 0;
  22. }
  23.  
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16: warning: comparison between signed and unsigned integer expressions
stdout
279
200
150
100
50