- double x=0;
- for(double y=1;y>=0;y-=0.01){
- x = Math.acos(y);
- for(double i=0;i<Math.PI-x;i+=0.01){
- System.out.print(" ");
- }
- System.out.print("M");
- for(double i=0;i<2*x;i+=0.01){//注意这里的判断条件,不要写成i<Math.PI+x,那样右边的字符回事接近一列。
- System.out.print(" ");
- }
- System.out.println("M");
- }
- }
复制代码 |
|