Grading of final exams (JAVA) __java

Source: Internet
Author: User

Problem Description

The final exam is over, the teacher wants to divide the grade according to the students ' grades. There are 5 grades A,b,c,d and E.
The Division method is as follows, 90 points (including 90) above for a,80~90 (including 80) between the b,70~80 (including 70) between the C,
60~70 (including 60) for D, the failure of the E.
According to the results of the input, programming output of the number of different levels.

Input

Enter the first row contains a positive integer n (n<= 100) represents the number of students, and then there are n rows of data per line an integer (0~100) represents
A student's score.
Output

The output has five elements in the following format:
A NA
B NB
C NC
D ND
E NE
Among them a,b,c,d,e represents the rank, NA,NB and so on represents the level the number, the level and the number has a space between.
Sample Input

6
66
73
85
99
100
59
Sample Output

A 2
B 1
C 1
D 1
E 1

import Java.util.Scanner public class main{public static void Main (string[) args) {
        Scanner cin = new Scanner (system.in);
        int T;
        int i;
        T = Cin.nextint ();
        int A, B, C, D, E;
        A = b = c = d = e = 0;
        int n;
            for (i = 1;i <= t;i + +) {n = cin.nextint ();
            if (n >=) A + +;
            if (n < m && n >=) b + +;
            if (n < m && n >=) C + +;
            if (n < c && N >=) d + +;
        if (n < a) e + +;
        } System.out.println ("A" + "" + a);
        System.out.println ("B" + "" + B);
        System.out.println ("C" + "" + C);
        System.out.println ("D" + "" + D);
        System.out.println ("E" + "" + e);
    Cin.close (); }
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.