Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string name;
- getline(cin, name);
- double points;
- cin >> points;
- int juryNum;
- cin >> juryNum;
- cin.ignore();
- string judgeName;
- double judgePoints;
- for (int i = 0; i < juryNum; i++) {
- getline(cin, judgeName);
- cin >> judgePoints;
- cin.ignore();
- points += judgeName.length() * judgePoints / 2;
- if (points > 1250.5) {
- break;
- }
- }
- cout.setf(ios::fixed);
- cout.precision(1);
- if (points > 1250.5) {
- cout << "Congratulations, " << name << " got a nominee for leading role with " << points << "!\n";
- }
- else {
- cout << "Sorry, " << name << " you need " << 1250.5 - points << " more!\n";
- }
- }
Add Comment
Please, Sign In to add comment