zoukankan      html  css  js  c++  java
  • 一维数组的练习

    public class Array1 {
        public static void main(String[] args){
    
            Pritimive d=new Pritimive();
            for (int i=0;i<d.t.length;i++){
                System.out.println(d.t[i]);
            }
            d.t[0]=true;
            d.t[1]=true;
            d.t[2]=true;
            for (int j=0;j<d.t.length;j++){
                System.out.println(d.t[j]);
            }
        }
    }
    class Pritimive{
        boolean[] t=new boolean[3];
    }

    import java.util.Scanner;
    public class w {
        public static void main(String[] args){
            //从键盘输入学生的个数
            Scanner s=new Scanner(System.in);
            System.out.println("请输入学生人数:");
            int count=s.nextInt();//写入学生个数
            System.out.println("请输入"+count+"个成绩:");
            //定义一个数组存储分数
            int[] scores=new int[count];
            //定义最高分
            int maxscore=0;
            //找到最高分
            for (int i=0;i< scores.length;i++){
                int score=s.nextInt();//写入学生成绩
                scores[i]=score;
                if (scores[i]>maxscore){
                    maxscore=scores[i];
    
                }
            }
            //输出最高分
            System.out.println("最高分是:");
            System.out.println(maxscore);
            //输出学生成绩
            for (int i=0;i<scores.length;i++){
                char grade;
                if (scores[i]>=maxscore-10){
                    grade='A';
                }else if (scores[i]>=maxscore-20){
                    grade='B';
                }else if (scores[i]>=maxscore-30){
                    grade='C';
                }else{
                    grade='D';
                }
                System.out.println("student "+i+" score is "+scores[i]+" grade is "+grade);
            }
        }
    }

  • 相关阅读:
    【IBM】netperf 与网络性能测量
    netperf 网络性能测试
    Netperf测试技巧
    网络测试工具--Iperf、Netperf 、MZ
    iozone
    iozone的使用与介绍-20191105
    XRDP freerdp
    性能工具 stream 最新版本5.10 The STREAM benchmark
    Linux学习之路-Linux-at及cron命令【7】---20171215
    centos7基于luks对磁盘进行加密
  • 原文地址:https://www.cnblogs.com/KeepCalmAndNeverSayNever/p/10099845.html
Copyright © 2011-2022 走看看