Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int d,r,x1,y1,x,y;
  7. x1=0;
  8. y1=6;
  9. r=6;
  10. x=0;
  11. y=6;
  12. d=3-2*r;
  13.  
  14. do
  15. {
  16. if(d<0) //T
  17. {
  18. d=d+4*x+6;
  19. x++;
  20. cout<<"Kordy: "<<x<<" "<<y<<endl;
  21. }
  22. else //S
  23. {
  24. d=d+4*(x-y)+10;
  25. x++;
  26. y--;
  27. cout<<"Kordy: "<<x<<" "<<y<<endl;
  28. }
  29. }while(x!=x1 && y!=y1);
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement