fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int tab[5] = { 1, 2, 4, 8, 16 };
  6. int *p1 = tab, *p2 = tab + 4;
  7. for(int *p = p1 + 1; p < p2; p++)
  8. *p = p[-1] * 2;
  9. cout << tab[1] << tab[2];
  10. return 0;
  11. }
  12.  
  13.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
24