黑马程序员技术交流社区

标题: 新手上课4天! 加油! [打印本页]

作者: 吴志超    时间: 2015-12-9 22:32
标题: 新手上课4天! 加油!
import java.util.Scanner;
class Demo7 {
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                       
                        System.out.println("请输入你的年龄:");
                        while (true) {
                       
                        int x = sc.nextInt();
                        if (true) {
                               
                          if (x>=1&& x<=12) {
                                System.out.println(x + "你是小学生");
                        } else if (x >=13&& x<= 15) {
                                System.out.println(x + "你是中学生");
                        } else if (x >=16&& x<= 18) {
                                System.out.println(x + "你是高中生");
                        } else  if (x >= 19 && x <= 21) {
                                System.out.println(x + "你是大学生");
                        } else {
                                System.out.println(x + "你以超神");
                }
          }       
        }
  }
}
{:3_65:}
作者: 闭关修行小和尚    时间: 2015-12-29 22:41
超哥,我来顶你了{:2_30:}
作者: 爱hao者    时间: 2015-12-29 22:45
加油吧,坚持到底
作者: 闭关修行小和尚    时间: 2015-12-29 22:52
超哥,你分怎么这么多
作者: 湛原    时间: 2015-12-29 23:27
我是来水黑马币的
作者: 小五哥    时间: 2015-12-30 00:12
加油加油
作者: 随缘的影子    时间: 2015-12-30 12:33
while+if判断语句?话说楼主,新班里讲的知识点和公布的视频里差得多吗?




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2