Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream cin("pozitiiconsecutive.in");
- ofstream cout("pozitiiconsecutive.out");
- int main()
- {
- int a,b,c=0;
- cin>>b>>a;
- cout<<a<<' '<<b<<' ';
- while (c!=3){
- c=2*b-a+2;
- a=b;
- b=c;
- cout<<c<<' ';
- }
- cout<<0;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement