Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <fstream>
  2.  
  3. using namespace std;
  4. ifstream cin("pozitiiconsecutive.in");
  5. ofstream cout("pozitiiconsecutive.out");
  6. int main()
  7. {
  8. int a,b,c=0;
  9. cin>>b>>a;
  10. cout<<a<<' '<<b<<' ';
  11. while (c!=3){
  12. c=2*b-a+2;
  13. a=b;
  14. b=c;
  15. cout<<c<<' ';
  16. }
  17. cout<<0;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement