Advertisement
Guest User

JD KURWE PSA

a guest
Apr 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. void przenies(char*x,char*y,char*z,int N)//funkcja
  5. { int L=0;
  6. if(N>0)
  7. {
  8. przenies(x,z,y,N-1);
  9. cout<<x<<"->"<<z<<""<<++L<<endl;
  10. przenies(y,x,z,N-1);
  11. }
  12. }
  13. int main()
  14. {
  15. int N;
  16. system("cls");
  17. cout<<"Podaj liczbke krazkow N=";
  18. cin>>N;
  19. przenies("A","B","C",N);
  20. getch();
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement