zoukankan      html  css  js  c++  java
  • Java学习----设计正真的应用程序

    import java.util.Scanner;
    
    // 输入10位学生的成绩,并且判断他们的成绩是哪个等级,其中90-100是A级,80-89是B级,70-79是C级,60-69是D级,60分以下E级
    public class App1 {
        public static void main(String[] args) {
            double[] scores = new double[10];
            Scanner scanner = new Scanner(System.in);
            
            // 读取键盘输入并且赋值给scores数组元素
            for (int i = 0; i < 10; i++) {
                System.out.println("请输入第" + i + "位学生的成绩");
                scores[i] = scanner.nextDouble();
            }
            
            for (int j = 0; j < 10; j++) {
                double temp = scores[j];
                if (temp >= 90 && temp <= 100) {
                    System.out.println(j + "是A");
                }
                else if (temp >= 80 && temp < 90) {
                    System.out.println(j + "是B");
                }
                else if (temp >= 70 && temp < 80) {
                    System.out.println(j + "是C");
                }
                else if (temp >= 60 && temp < 70) {
                    System.out.println(j + "是D");
                }
                else {
                    System.out.println(j + "是E");
                }
            }
        }
    }
  • 相关阅读:
    幂等设计
    Dubbo
    Kubernetes-K8S
    Log4Net配置以及使用
    网站对话框开源脚本--ArtDialog V6.0
    实现VS2010整合NUnit进行单元测试(转载)
    HTML+CSS页面滚动效果处理
    Bootstrap 表格 笔记
    Bootstrap 排版 笔记
    Bootstrap简介
  • 原文地址:https://www.cnblogs.com/dragon1013/p/5036564.html
Copyright © 2011-2022 走看看