JAVA学习日记之判断写法
其实也和PHP差不多
Scanner sc = new Scanner(System.in);
System.out.println("你是无量都商家,打算给小布什多少个坏鸡蛋");
int hd = sc.nextInt();
if(hd < 5){
System.out.println("小布什回家吃掉了");
}else{
System.out.println("小布:你给我都怎么全是坏鸡蛋");
System.out.println("我:不退钱,我是无良商家");
System.out.println("小布:我**%¥@#@¥@#@¥@¥@¥");
};
System.out.println("---------------分割线------------------------");
System.out.println("请输入A都值");
int a = sc.nextInt();
System.out.println("请输入B都值");
int b = sc.nextInt();
if((b%a==0)||((a+b)>=1000)){
System.out.println("输出A:"+a);
}else{
System.out.println("输出B:"+b);
};
声明:本站原创文章文字版权归本站所有,转载务必注明作者和出处;本站转载文章仅仅代表原作者观点,不代表本站立场,图文版权归原作者所有。如有侵权,请联系我们删除。