⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multiplyloop3.java

📁 本java源程序包括了大量的学习程序(共27章)方便大家学习
💻 JAVA
字号:
class MultiplyLoop3
{
	public static void main(String[] args) 
	{
		MultiplyLoop3 multiplyLoop3 = new MultiplyLoop3();
		multiplyLoop3.print(11);
	}
	
	public void print(int n)
	{
		int temp = 0;
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < Math.abs(n/2-i); j++)
				System.out.print(" ");
		    if(i <= n/2)
		    	temp = i;
		    else
		    	temp = n - i - 1;
			for(int k = 0; k < (2*temp + 1); k++)
				System.out.print("*");		
			System.out.println();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -