a53

PozitiiConsecutive

a53
Jan 3rd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. ifstream fin("pozitiiconsecutive.in");
  5. ofstream fout("pozitiiconsecutive.out");
  6. unsigned long long x, y, z;
  7. int main()
  8. {
  9. fin>>x>>y;
  10. z=2*x-y+2;
  11. fout<<y<<" "<<x<<" "<<z<<" ";
  12. while(z)
  13. {
  14. y=x;
  15. x=z;
  16. z=2*x-y+2;
  17. fout<<z<<" ";
  18. }
  19. return 0;
  20. }
Add Comment
Please, Sign In to add comment