SHARE
TWEET

Untitled

a guest Nov 13th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <unistd.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int N=35, y0=5,x0=5,r=6,n=r+r;
  9.         for (int y=0; y<N;y++){
  10.             for (int x=0; x<N; x++){
  11.                 int o = x%n;
  12.                 int p = y%n;
  13.                 int d2=(o-x0)*(o-x0)+(p-y0)*(p-y0);
  14.                 if (d2<r*r){
  15.                     cout <<"* ";
  16.                 }
  17.                 else{
  18.                     cout<<"  ";
  19.                 }
  20.             }
  21.             cout<<endl;
  22.         }
  23.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top