Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int r;
  8. cout << "Podaj promien: ";
  9. cout << endl;
  10. r=12;
  11.  
  12. for(int z=0; z<r; z++){
  13. for(int x=0; x<r; x++)
  14. {
  15. if( x*x + z*z < r)
  16. cout << " ";
  17. else
  18. cout << "x";
  19. }
  20.  
  21. for(int x=r; x>=0; x--)
  22. {
  23. if( x*x + z*z < r)
  24. cout << " ";
  25. else
  26. cout << "x";
  27. }
  28. cout << endl;
  29.  
  30. }
  31.  
  32. for(int z=r; z>=0; z--){
  33. for(int x=0; x<r; x++)
  34. {
  35. if( x*x + z*z < r)
  36. cout << " ";
  37. else
  38. cout << "x";
  39. }
  40.  
  41. for(int x=r; x>=0; x--)
  42. {
  43. if( x*x + z*z < r)
  44. cout << " ";
  45. else
  46. cout << "x";
  47. }
  48. cout << endl;
  49.  
  50. }
  51.  
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement