標題:
[模擬考]TQC+ 208
[打印本頁]
作者:
王彥甯
時間:
2017-6-10 12:21
標題:
[模擬考]TQC+ 208
完成TQC+ 208 題目
作者:
王彥甯
時間:
2017-6-10 12:22
import java.util.*;
class JPD02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
test();
test();
}
public static void test() {
System.out.println("Input:");
int s = keyboard.nextInt();
if(s>=90)
{
System.out.println("Your grade is A");
}
else if(90>s & s>=80)
{
System.out.println("Your grade is B");
}
else if(80>s & s>=70)
{
System.out.println("Your grade is C");
}
else if(70>s & s>=60)
{
System.out.println("Your grade is D");
}
else
{
System.out.println("Your grade is F");
}
}
}
複製代碼
作者:
張健勳
時間:
2017-6-10 12:24
import java.util.*;
public class JPA02{
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
test();
test();
}
public static void test() {
System.out.println("Input:");
int g = keyboard.nextInt();
if (g>=90)System.out.println("Your grade is A");
else if (g>=80)System.out.println("Your grade is B");
else if (g>=70)System.out.println("Your grade is C");
else if (g>=60)System.out.println("Your grade is D");
else System.out.println("Your grade is F");
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2