日常作业-if

package com.company;

import java.util.Scanner;

public class che {

public static void main(String[] args) {

Scanner scanner =new Scanner(System.in);

        System.out.println("你有多少钱买车");

        int score = scanner.nextInt();

        if (score >500){

System.out.println("买特斯拉");

        }else  if (score>100){

System.out.println("买奥特曼");

        }else if (score>50){

System.out.println("付房子首付");

        }else if (score>10){

System.out.println("买手办");

        }else if(score<10){

System.out.println("买手机、电脑");

        }

}

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容