求解释

xiaoxiao2021-02-28  100

public void puMap() { for (int y = 0; y <= 2 * r; y += 2) { long x = Math.round (r - Math.sqrt(2 * r * y - y * y)); double longLength = 2 * (r - x); for (int i = 0; i <= x; i++) { System.out.print(' '); } System.out.print('*'); for (int j = 0; j <= longLength; j++) { System.out.print(' '); } System.out.println('*'); } }

其解释这段代码,是打印空心圆的,但是里面代码不是很懂,求解释和注释代码,谢谢大神们

转载请注明原文地址: https://www.6miu.com/read-60978.html

最新回复(0)