Guest User

Untitled

a guest
Jun 23rd, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n, c, i = 0, p = 1, w;
  9. int a[1000];
  10. for ( c = 0 ; c < 50; c++ )
  11. {
  12. if ( c <= 1 )
  13. w = c;
  14. else
  15. {
  16. w = i + p;
  17. i = p;
  18. p = w;
  19. }
  20. a[c]=w;
  21. }
  22.  
  23. int o;
  24. cin>>o;
  25. for(int x=o;x<50;x++)
  26. {
  27. cout<<a[x];
  28. break;
  29. }
  30.  
  31. system("pause");
  32. }
Add Comment
Please, Sign In to add comment