1110

---恢复内容开始---

int n=2;
for(System.out.println("a");n>0;System.out.println("c"))
{
  System.out.println("b");
  n--;
}
输出 a b c b c
public class Xin 
{
	public static void main(String[] args) 
	{
		for(int i=0;i<5;i++)
		{
			for(int j=0;j<5-i;j++)
			{
				System.out.print("*");
			}
			System.out.print("\n");
		}
	}
}
输出
*****
****
***
**
*

  println代表换行输出,printf是输出不换行

---恢复内容结束---

猜你喜欢

转载自www.cnblogs.com/mo-mo-mu/p/9939329.html