Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long a,b,sa=0,sb=0,p,c=0;
  8. for (int i=0;i<5;i++){
  9. cin>>a>>b;
  10. if (a<(b/2)) c++;
  11. sa+=a;
  12. sb+=b;
  13. }
  14. p=(sa*100)/sb;
  15. if (c>=1) cout <<"Fail";
  16. else if (p>=85) cout <<"Excellence";
  17. else if (p>=75) cout <<"Very Good";
  18. else if (p>=65) cout <<"Good";
  19. else if (p>=55) cout <<"Fair";
  20. else if (p>=50) cout <<"Weak";
  21. else if (p<50) cout <<"Fail";
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement