Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <unistd.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int N=100,y0=5,x0=5,r=6,A=r+r;
  9.         for (int y=0; y<N;y++){
  10.             for (int x=0; x<N; x++){
  11.                 int B=y%A;
  12.                 int C=x%A;
  13.                 int d2=(C-x0)*(C-x0)+(B-y0)*(B-y0);
  14.  
  15.                 if (d2 >= r*r - 5 && d2 <= r*r + 4){
  16.                     cout <<"* ";
  17.                 }
  18.                 else{
  19.                     cout<<"  ";
  20.                 }
  21.             }
  22.             cout<<endl;
  23.         }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement