Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- int r;
- cout << "Podaj promien: ";
- cout << endl;
- r=12;
- for(int z=0; z<r; z++){
- for(int x=0; x<r; x++)
- {
- if( x*x + z*z < r)
- cout << " ";
- else
- cout << "x";
- }
- for(int x=r; x>=0; x--)
- {
- if( x*x + z*z < r)
- cout << " ";
- else
- cout << "x";
- }
- cout << endl;
- }
- for(int z=r; z>=0; z--){
- for(int x=0; x<r; x++)
- {
- if( x*x + z*z < r)
- cout << " ";
- else
- cout << "x";
- }
- for(int x=r; x>=0; x--)
- {
- if( x*x + z*z < r)
- cout << " ";
- else
- cout << "x";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement