fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6. bool pixels[40][80] = {};
  7. for(unsigned i = 0; i < 80; ++i)
  8. {
  9. double pos = std::sin(2*3.1415926/80*i)*15+20;
  10. pixels[unsigned(pos)][i] = true;
  11. }
  12. for(unsigned r = 0; r < 40; ++r)
  13. {
  14. for(unsigned c = 0; c < 80; ++c)
  15. {
  16. std::cout << (pixels[r][c] ? '#' : ' ');
  17. }
  18. std::cout << std::endl;
  19. }
  20. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                        #########               
                                                      ##         ##             
                                                    ##             ##           
                                                   #                 #          
                                                  #                   #         
                                                 #                     #        
                                                #                       #       
                                               #                         #      
                                              #                           #     
                                             #                             #    
                                            #                               #   
                                           #                                 #  
                                          #                                   # 
                                         #                                     #
                                                                                
#                                       #                                       
 #                                     #                                        
  #                                   #                                         
   #                                 #                                          
    #                               #                                           
     #                             #                                            
      #                           #                                             
       #                         #                                              
        #                       #                                               
         #                     #                                                
          #                   #                                                 
           #                 #                                                  
            ##             ##                                                   
              ##         ##                                                     
                #########