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

📄 question1.java

📁 java课程的资料以及实验的代码
💻 JAVA
字号:
class FindMax
{
	public static void testMaxOfThree(int a,int b,int c)
	{
		int max; // stores the maximum number 
		max=(a>b)?a:b;
		max=(max>c)?max:c;
		System.out.println("The maximum number is:"+max);
	};
	
	public static void main(String args[])
	{
		int length=args.length;
		if (length<3) // if the number of arguments is less than 3, exit
		{
			System.out.println("invalid number of arguments\n");
			System.exit(1);
		};
		int a,b,c;
		a=Integer.parseInt(args[0]);
		b=Integer.parseInt(args[1]);
		c=Integer.parseInt(args[2]); // obtain the three numbers
		testMaxOfThree(a,b,c);
	}
}

⌨️ 快捷键说明

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