Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- string name;
- getline(cin, name);
- double points;
- int juryNum;
- cin >> points >> juryNum;
- int juryCOunter = 0;
- double academyPoints = 0;
- while(juryCOunter < juryNum){
- string juryName;
- cin.ignore();
- getline(cin, juryName);
- double juryPoints;
- cin >> juryPoints;
- juryCOunter++;
- double earnedPoints = juryName.size() * juryPoints / 2 ;
- academyPoints += earnedPoints;
- }
- double sumAllPoints = academyPoints + points;
- if(sumAllPoints < 1250.5){
- cout << "Sorry, " << name << " you need " << 1250.5 - sumAllPoints << " more!" << endl;
- }else {
- cout << "Congratulations, " << name << "got a nominee for leading role with " << sumAllPoints << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement