Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- using namespace std;
- void przenies(char*x,char*y,char*z,int N)//funkcja
- { int L=0;
- if(N>0)
- {
- przenies(x,z,y,N-1);
- cout<<x<<"->"<<z<<""<<++L<<endl;
- przenies(y,x,z,N-1);
- }
- }
- int main()
- {
- int N;
- system("cls");
- cout<<"Podaj liczbke krazkow N=";
- cin>>N;
- przenies("A","B","C",N);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement