java吧 关注:1,303,696贴子:12,860,044
  • 3回复贴,共1
package com.nodota;
import java.util.Scanner;
public class Score {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
System.out.println("请输入考试成绩: ");
int score = in.nextInt();
while(score<=100&&score>=90){
System.out.println("A");
//in.nextInt();
break;
}
while(score<=89&&score>=80){
System.out.println("B");
//continue;
break;
}
while(score<=79&&score>=70){
System.out.println("C");
//continue;
break;
}
while(score<=69&&score>=60){
System.out.println("D");
//continue;
break;
}
while(score<=59&&score>=0){
System.out.println("E");
//continue;
break;
}
while(score<0&&score>100){
System.out.println("输入有误,请重新输入");
//continue;
break;
}


1楼2014-11-04 18:07回复
    程序结束后如何再继续进入输入界面


    2楼2014-11-04 18:08
    回复
      2026-05-30 18:57:17
      广告
      不感兴趣
      开通SVIP免广告
      就是不想这个程序执行一次就结束了


      3楼2014-11-04 18:09
      回复
        就是运行程序以后输入数字然后程序就结束了,而我想继续让他再进入出现输入界面就不用反复执行该怎么办


        4楼2014-11-04 18:12
        回复