一个挺好玩的代码,有兴趣的可以看看
class sin
{
public static void main(String[] args)
{
for (double x=0;true;x+=0.2)
{
for (double y=-4;y<=2;y+=0.1)
{
double z=0.1;
double a=y-Math.sin(x);
System.out.print((a>=-z&&a<=z)?"|":" ");
}
System.out.println();
try{
Thread.sleep(20);
}catch(Exception ee){
}
}
}
}
|
|