ifexam.java

来自「java的一些小型程序代码」· Java 代码 · 共 44 行

JAVA
44
字号
/*
 * Created on 2007/03/23
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
import java.io.*;
/**
 * @author BFJ1
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ifexam {

	public static void main(String[] args) throws IOException {
		int examscore = 0;
		try
		{
			System.out.println("Input your examscore:");
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			examscore=Integer.parseInt(in.readLine());
		}
		catch(Exception e)
		{
			System.out.println("Input Error!");
		}
		if (examscore>=0&&examscore<=100)
		{
			System.out.print(examscore);
			if (examscore<60)
				System.out.println("- Bad score.");
			else if(examscore>=60&&examscore<80)
				System.out.println("- Just so so.");
			else
				System.out.println("- Good score.");	
		}
		else 
		{
			System.out.println("examscore is invalid.");
		}	
	}
}

⌨️ 快捷键说明

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