zoukankan      html  css  js  c++  java
  • 根据考试成绩输出对应的礼物,90分以上爸爸给买电脑,80分以上爸爸给买手机, 60分以上爸爸请吃一顿大餐,60分以下爸爸给买学习资料。 要求:该题使用多重if完成


    package
    com.Summer_0417.cn; import java.util.Scanner; /** * @author Summer * 根据考试成绩输出对应的礼物, * 90分以上爸爸给买电脑, * 80分以上爸爸给买手机, * 60分以上爸爸请吃一顿大餐,60分以下爸爸给买学习资料。 * 要求:该题使用多重if完成 */ public class Test_Method09 { public static void main(String[] args) { //键盘录入一个成绩 Scanner sc = new Scanner(System.in); System.out.println("请输入您的成绩:"); int score = sc.nextInt(); //判断这个成绩,输出相应的值 if (score>=60) { System.out.println("60分以上爸爸请吃一顿大餐"); if (score>=90) { System.out.println("90分以上爸爸给买电脑"); return; } if (score>=80) { System.out.println("80分以上爸爸给买手机"); } }else{ System.out.println("60分以下爸爸给买学习资料"); } } }
  • 相关阅读:
    iframe跨页面调用函数
    $.extend()
    tab标签 插件 by 腾讯 jianminlu
    click事件多次触发 jQuery
    vertical-align
    display:inline-block
    在父页面访问iframe的东西
    2019牛客多校第三场
    2019HDU多校第一场
    2019江苏省赛
  • 原文地址:https://www.cnblogs.com/summerdata/p/10726387.html
Copyright © 2011-2022 走看看