Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <iostream>
- using namespace std;
- int main ()
- {
- int amin=4, amax=7, akiek=4, b[3], i=8, n, c;
- cin>>n;
- b[0]=5;
- b[1]=6;
- b[2]=8;
- switch(n)
- {
- case 1 :cout<<2<<"_"<<1;break;
- case 2 :cout<<3<<"_"<<5;break;
- case 3 :cout<<4<<"_"<<6;break;
- case 4 :cout<<7<<"_"<<8;break;
- default:
- {
- while (akiek<n)
- {
- i++;
- c=b[0]+b[1];
- if(c == i)
- {
- amin=amax;
- amax=i;
- cout<<amax<<" "<<amin;
- akiek++;
- }
- else
- {
- b[0]=b[1];
- b[1]=b[2];
- b[2]=i;
- cout<<b[0]<<" "<<b[1]<<" "<<b[2]<<endl;
- }
- }
- cout<<amax<<"_"<<b[2];
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement