fork download
  1. #include<iostream>
  2.  
  3. int main() {
  4. int x=0,
  5. y=1,
  6. z,
  7. n;
  8.  
  9. for (n = 0; n < 20; n++)
  10. {
  11. z=x+y;
  12.  
  13. std::cout << z << " ";
  14.  
  15. y=x;
  16. x=z;
  17. }
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765