心型打印[
package play;
public class Heart {
public static void main(String[] args) {
for (float i = 1.5f; i >- 1.5f; i-=0.15f) {
for (float j = -1.5f; j < 1.5f; j+=0.05f) {
float a=i*i+j*j-1;
String str=(a*a*a-j*j*i*i*i)<=0.0f? "*":" ";
System.err.print(str);
}
System.out.println("");
}
}
}