fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13.  
  14.  
  15. int num = 7;
  16. for (double y = 1 ; y >= -1 ; y-=0.2) {
  17. double ny = y-0.2;
  18. for (double x = 0; x <= num; x+=0.2) {
  19. double s = Math.sin(x);
  20. if (s >= ny && s < y)
  21. System.out.print('*');
  22. else
  23. System.out.print(' ');
  24. }
  25. System.out.println();
  26. }
  27.  
  28.  
  29.  
  30. }
  31. }
Success #stdin #stdout 0.1s 320320KB
stdin
Standard input is empty
stdout
     *******                       
    *       *                      
   *         *                    *
  *           *                  * 
 *             *                *  
*               *              *   
                 *            *    
                  *          *     
                   **      **      
                     ******