Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Grading Students
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, std[100]; // number of students
- cin >> n;
- for(int i=0;i<n;i++)
- {
- cin >> std[i];
- if(std[i]<38)
- {
- cout << std[i] << endl;
- }
- else
- {
- for(int a=1;a<21;a++)
- {
- if((5*a)>=std[i])
- {
- if(((5*a)-std[i])<3)
- {
- cout << 5*a << endl;
- break;
- }
- else
- {
- cout << std[i] << endl;
- break;
- }
- }
- }
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment