A query program, students receive input from the user's five grades (high number, English, computer basic, professional class 1, professional class 2), according to the following rules tips can get the scholarship, as well as the sum of all scholarships,
Rules:
1. English is more than 95 points, 100 scholarship,
2. High number and basic computer either at hkust in 95 points, scholarship, 100;
3. Professional class 1 and professional class 2 grade point averages more than 95 points, and the other three did not fail courses, students get scholarships 200
CodePudding user response:
This problem is not difficult, is the judgment, wrote a reference
#include
#include
Int main ()
{
Int cj [5]={0};
Int I, aver=0, total=0;
Printf (" input results: \ n ");
for (i=0; i<5; I++)
The scanf (" % d ", & amp; Cj [I]);
Aver=+ cj (cj [3] [4])/2;
If (cj [1] & gt; 95)
Total +=100;
If (cj [0] & gt; 95 | | cj [2] & gt; 95)
Total +=100;
If (aver & gt; 95 & amp; & Cj [0] & gt; 60 & amp; & Cj [1] & gt; 60 & amp; & Cj [2] & gt; 60)
Total +=200;
Printf (" total scholarship: % d \ n ", total);
Getchar ();
return 0;
}