这是一个学生的等级判断,因为之前已经搞过很多出来,所以也不算太难
import javax.swing.*;
public class GradeIf {
public static void main (String args[]){
int x;
String s=(String)JOptionPane.showInputDialog(null,"请输入成绩","学生成绩等级判断",
JOptionPane.PLAIN_MESSAGE,null,null,null);
x=Integer.parseInt(s);
{if(x>=85)
System.out.println("A");
if(x<85&&x>=70)
System.out.println("B");
if(x<70&&x>=60)
System.out.println("C");
if(x<60)
System.out.println("D");
}
}
}