
我学了JAVA基础 可是要实际操作 要练习敲敲代码拜托各位了 3Q
求小程序啊谁有小程序啊最好要用到类对象之类的小弟俺非常之感谢不要太难了哈我怕我写不来不过也不要都是数学题哈麻烦大家想想了哈谢了...
求小程序啊 谁有小程序啊 最好要用到类 对象之类的 小弟俺非常之感谢 不要太难了哈 我怕我写不来 不过也不要都是数学题哈 麻烦大家想想了哈 谢了
展开
2个回答
展开全部
import java.util.Scanner; public class inPutAge { /** * @param args */ public static void main(String[] args) { // TODO 自动生成方法存根 Scanner s = new Scanner(System.in); int iAge; System.out.println("请输入您的年龄:"); iAge = s.nextInt(); if (iAge > 0 && iAge < 18) { System.out.println("未成年人"); } else if (iAge >= 18 && iAge < 30) { System.out.println("青年人"); } else if (iAge >= 30 && iAge < 50) { System.out.println("中年人"); } else if (iAge >= 50 && iAge < 200) { System.out.println("老年人"); } else { System.out.println("超人"); } } }
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询