Advertisement
Fakhru

Untitled

Nov 13th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1.     #include <stdio.h>
  2.     #include <math.h>
  3.     int main()
  4.     {
  5.     int x, y, size=20;
  6.     for (x=0; x<size; x++)
  7.     {
  8.     for (y=0; y<=4*size; y++)
  9.     {
  10.     double dist1 = sqrt( pow(x-size,2) + pow(y-size,2) );
  11.     double dist2 = sqrt( pow(x-size,2) + pow(y-3*size,2) );
  12.     if (dist1 < size + 0.5 || dist2 < size + 0.5 )
  13.     printf("%c",97);
  14.     else
  15.     printf(" ");
  16.     }
  17.     printf("\n");
  18.     }
  19.     for (x = 1; x <= 2*size; x++)
  20.     {
  21.     for (y=0; y<x; y++)
  22.     printf(" ");
  23.     for (y=0; y<4*size + 1 - 2*x; y++)
  24.     printf("%c",86);
  25.     printf("\n");
  26.     }
  27.      
  28.     return 0;
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement