fork(2) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. vector<vector<bool> > Tb(50,vector<bool>(50));
  7.  
  8. int main()
  9. {
  10. const double Z=2*M_PI;
  11. const double A=25/Z;
  12. const unsigned steps=1000;
  13.  
  14. for(unsigned i=1;i<=steps;++i)
  15. {
  16. double f=Z*i/steps,r=A*f;
  17. Tb[25+r*sin(f)][25-r*cos(f)]=true;
  18. }
  19. for(unsigned y=0;y<50;++y,cout<<endl) for(unsigned x=0;x<50;++x) cout<<" @"[Tb[y][x]]<<' ';
  20. return 0;
  21. }
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                    @ @ @ @ @ @                                                     
                            @ @ @ @ @         @ @ @ @ @                                             
                        @ @ @                         @ @ @                                         
                    @ @ @                                 @ @ @                                     
                @ @ @                                         @ @                                   
              @ @                                               @ @                                 
            @ @                                                   @ @                               
          @ @                                                       @ @                             
        @ @                                                           @ @                           
        @                                                               @                           
      @                                                                 @ @                         
    @ @                                                                   @                         
    @                                                                     @                         
  @ @                                                                     @                         
  @                                                                       @ @                       
  @                                                                         @                       
@                                                                           @                       
@                                                                         @ @                       
@                                                                         @                         
@                                                                         @                         
                                              @ @                         @                         
                                            @ @                         @ @                         
                                            @                           @                           
                                            @ @                       @ @                           
                                              @                     @ @                             
                                              @ @               @ @ @                               
                                                @ @ @       @ @ @                                   
                                                    @ @ @ @ @