Advertisement
Guest User

Untitled

a guest
Jul 28th, 2019
1,301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.     string name;
  9.     getline(cin, name);
  10.     double points;
  11.     int juryNum;
  12.     cin >> points >> juryNum;
  13.     int juryCOunter = 0;
  14.     double academyPoints = 0;
  15.  
  16.  
  17.  
  18.     while(juryCOunter < juryNum){
  19.             string juryName;
  20.             cin.ignore();
  21.             getline(cin, juryName);
  22.             double juryPoints;
  23.             cin >> juryPoints;
  24.             juryCOunter++;
  25.             double earnedPoints =  juryName.size() * juryPoints / 2 ;
  26.             academyPoints += earnedPoints;
  27.  
  28.     }
  29.     double sumAllPoints = academyPoints + points;
  30. if(sumAllPoints < 1250.5){
  31.  
  32.     cout << "Sorry, " << name << " you need " << 1250.5 - sumAllPoints << " more!" << endl;
  33.  
  34. }else {
  35.  
  36.     cout << "Congratulations, " << name << "got a nominee for leading role with " << sumAllPoints << endl;
  37.  
  38.  
  39.     }
  40.  
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement