Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unistd.h>
- using namespace std;
- int main()
- {
- int N=100,y0=5,x0=5,r=6,A=r+r;
- for (int y=0; y<N;y++){
- for (int x=0; x<N; x++){
- int B=y%A;
- int C=x%A;
- int d2=(C-x0)*(C-x0)+(B-y0)*(B-y0);
- if (d2 >= r*r - 5 && d2 <= r*r + 4){
- cout <<"* ";
- }
- else{
- cout<<" ";
- }
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement