標題:
208-分級制度
[打印本頁]
作者:
許承鴻
時間:
2018-6-19 20:18
標題:
208-分級制度
import java.util.*;
class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
test();
test();
}
public static void test() {
...
}
}
作者:
巫沛庭
時間:
2018-6-19 20:24
import java.util.*;
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 s=keyboard.nextInt();
if(s>=90)
{
System.out.println("Your grade is A");
}
else if(s>=80)
{
System.out.println("Your grade is B");
}
else if(s>=70)
{
System.out.println("Your grade is C");
}
else if(s>=60)
{
System.out.println("Your grade is D");
}
else
{
System.out.println("Your grade is F");
}
}
}
複製代碼
作者:
張閎鈞
時間:
2018-6-19 20:26
import java.util.Scanner;
public class OP321 {
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 a=keyboard.nextInt();
if(a>=90)
{
System.out.println("Your grade is A");
}
else if(a>=80)
{
System.out.println("Your grade is B");
}
else if(a>=70)
{
System.out.println("Your grade is C");
}
else if(a>=60)
{
System.out.println("Your grade is D");
}
else
{
System.out.println("Your grade is F");
}
}
}
複製代碼
作者:
巫晉宇
時間:
2018-6-19 20:30
import java.util.Scanner;
public class JPA01 {
static Scanner o= new Scanner(System.in);
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
test();
test();
test();
test();
test();
}
private static void test() {
// TODO 自動產生的方法 Stub
System.out.print("Input score:");
int c = o.nextInt();
if(c>=90)
{
System.out.println("Your grade is A");
}
if(c>=80)
{
System.out.println("Your grade is B");
}
if(c>=70)
{
System.out.println("Your grade is C");
}
if(c>=60)
{
System.out.println("Your grade is D");
}
if(c<60)
{
System.out.println("Your grade is F");
}
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2