fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. const int N = 10;
  5.  
  6. int I[N] = {1,2,3,4,5,6,7,8,9,0};
  7. int J[N];
  8.  
  9. for( int i=0; i<N; ++i )
  10. {
  11. J[i] = I[i] + i;
  12. std::cout << J[i] << " ";
  13. }
  14. std::cout << '\n';
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1 3 5 7 9 11 13 15 17 9