Advertisement
Josif_tepe

Untitled

Mar 17th, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>  
  2. using namespace std;  
  3. int main()  
  4. {  
  5. int o,t1,t2,t3,t4,a,b,c,poeni,prosek;
  6. cin>>o;
  7. cin>>t1>>t2>>t3>>t4;
  8.  
  9. if(o==2){
  10. poeni=60;
  11. }
  12. if(o==3){
  13. poeni=70;
  14. }
  15. if(o==4){
  16. poeni=80;
  17. }
  18. if(o==5){
  19. poeni=90;
  20. }
  21.  
  22.  
  23. for(int i=0;i<=100;i++){
  24.    
  25. prosek=(t1+t2+t3+t4+i)/5;
  26. if(prosek>=poeni){
  27.     cout<<i<<endl;
  28.     return 0;
  29. }
  30. }
  31.  
  32. cout<<"GRESHKA"<<endl;
  33.  
  34.  
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement