標題:
[模擬考]TQC+ 202
[打印本頁]
作者:
王彥甯
時間:
2017-6-10 12:18
標題:
[模擬考]TQC+ 202
完成TQC+ 202 題目
作者:
王彥甯
時間:
2017-6-10 12:18
import java.util.*;
class JPD02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
}
public static void test() {
System.out.println("Input:");
int a = keyboard.nextInt();
int b = keyboard.nextInt();
if(a>b)
{
System.out.printf("%d is larger than %d\n",a,b);
}
else if(a<b)
{
System.out.printf("%d is larger than %d\n",b,a);
}
}
}
複製代碼
作者:
張健勳
時間:
2017-6-10 12:22
import java.util.*;
class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
}
public static void test() {
int num1 =0 , num2 =0;
System.out.println("Input");
num1 = keyboard.nextInt();
num2 = keyboard.nextInt();
if (num2>num1)
System.out.println(num2+" is larger than "+num1);
else if (num2<num1)
System.out.println(num1+" is larger than "+num2);
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2