Java Lab1 Problem5--EBU4201 Lab1 答案与解析

Java Lab1 Problem5--EBU4201 Lab1 答案与解析

public class Problem5
{

	public static void main(String[] args)
	{
		int loopUntil = Integer.parseInt(args[0]);
		for (int i = 0; i < loopUntil; i++)
		{
			System.out.print(" " + i);
			System.out.print(":");
			for (int j = loopUntil; j > 0; j--)
			{
				if ((i + j) % 3 == 0)
				{
					System.out.print("*");
				} else
				{
					System.out.print(j);
				}

			}
			System.out.println();

		}
		System.out.println();

	}

}

运行与测试代码:

javac Problem5.java
java Problem5 6
上一篇:ChCore Lab1 机器启动


下一篇:MIT6.824 2020 Lab1 MapReduce 实现