// 圆
package week9;
public class m{
public static void main(String[] args) {
int radius = 5;
for (int y = 0; y <= (2 * radius); y++)
{
for (int x = 0; x <= (2 * radius) ; x++)
{
if(Math.pow(x - radius, 2) + Math.pow(y - radius, 2) == Math.pow(radius,2))
System.out.print("*");
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}
// 正方形
int length = 5;
for(int i = 0; i < length; i++)
{
for (int j = 0; j < length; j++)
{
if(i == 0 || i == length -1)
System.out.print("*");
else
if(j == 0 || j == length - 1)
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}