标题:小问题,可就是不明白,呵呵,菜鸟不要见怪啊。
取消只看楼主
wewoor
Rank: 1
等 级:新手上路
帖 子:25
专家分:5
注 册:2010-10-4
结帖率:75%
已结贴  问题点数:20 回复次数:0 
小问题,可就是不明白,呵呵,菜鸟不要见怪啊。
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Test_ extends JFrame{
     public static void main(String arg[]){
         Test B=new Test();
         B.Fn();
         
     }
     void Fn(){
         String str=JOptionPane.showInputDialog("请输入你的成绩:");
         int a=Integer.parseInt(str);

         if (a>=60&&a<80)
              JOptionPane.showMessageDialog(this,"恭喜你及格了!,继续加油!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
         if (a>=80&&a<100);
          JOptionPane.showMessageDialog(this,"very good!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
         if (a<60&&a>40||a==40)
             JOptionPane.showMessageDialog(this,"you need to study hard!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
         if(a<40||a==40)
             JOptionPane.showMessageDialog(this,"hope you to have a good attitude","成绩情况",JOptionPane.INFORMATION_MESSAGE);
         if(a>100)
             JOptionPane.showMessageDialog(this,"error","成绩情况",JOptionPane.INFORMATION_MESSAGE);
         
     }     
         
 
}



当我输入12时,它为什么还会弹出very good 啊?
搜索更多相关主题的帖子: void 100 public import 
2010-11-24 17:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-326762-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097651 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved