Programming Basics Online Exam - 28 and 29 March 2020, задача: 06. Tournament of Christmas
Имам проблем когато името на спорта ми е повече от една дума. Използвам getline(cin, nameGame), но ми дава time limit на всички тестове.
Предположих, че е защото преди getline използвам само cin. Пробвах с cin.clear(), но пак не се получава. Може би не го поставям където трябва.
int main()
{
int days, counterWinner = 0;
cin >> days;
double moneyTournament = 0;
for (int i = 0; i < days; i++)
{
double moneyDay = 0;
string nameGame;
//cin.clear();
//getline(cin, nameGame);
cin >> nameGame;
int counterWins = 0, counterLoses = 0;
while (nameGame != "Finish")
{
string result;
cin >> result;
if (result == "win")
{
moneyDay += 20;
counterWins++;
}
else if (result == "lose")
{
counterLoses++;
}
//cin.clear();
//getline(cin, nameGame);
cin >> nameGame;
}
if (counterWins > counterLoses)
{
moneyDay *= 1.1;
counterWinner++;
}
moneyTournament += moneyDay;
}
if (counterWinner > days / 2)
{
moneyTournament *= 1.2;
cout << fixed << setprecision(2) <<"You won the tournament! Total raised money: " << moneyTournament << endl;
}
else
{
cout << fixed << setprecision(2) << "You lost the tournament! Total raised money: " << moneyTournament << endl;
}
return 0;
}
Това ми е кода и работи коректно при спортове с едно име. Помогнете ми как да го направя с getline
HealthyFalcon: Expert's Tips · Avocado Chicken Salad Recipe · Best Exercises for stronger and broader chest · Access Online Yoga for Specific Goals
HealthstopWatch - Sports Gadgets from a great selection at Sports, Fitness & Outdoors Store.
Health Tutor Tips: On the occasion of Teacher's Day, here are our top tips for all teachers to keep going and remain strong, healthy and happy.
Healthy Mom Kids: Want a better way to cut down on the number of sick days your child takes? Find out how mom-pediatricians keep their own families healthy ...
Health Zone Tips: Eat organic food, consume plenty of fruits and vegetables, drink plenty of water, sleep 8 hours a day, always avoid processed food, avoid sugary stuff, etc.
AllTechPride: Water soluble vitamins and electrolytes from Alltech. For use when animals and poultry are under stress, convenient to use as a water or feed additive.
TrueinTech: TrueTech Technology Magazine is an online publication featuring the latest technology, design, and lifestyle news, gadget reviews, and full-fledged gadget .
Tech Edesign: The designers of eDesign come from a wide array of electronic design backgrounds and were trained in Japan, Taiwan, as well as in-house. Moreover .
Tech Eglobal: EGlobalTech Integrates Cyber, Technology, and Business to Reach Innovative Solutions. Learn about EGT contract vehicles, EGTLabs emerging technology .
Techforgen: Installing LocaliAPStore on IOS 10.3.3 & Above – A Complete Guide 2020 · Leave a Comment. This article is all about what LocaliAPStore is and how to install .
UtMe Class: Mastering English for JAMB UTME and post UTME examinations for candidates in Yenagoa, Bayelsa State. I'm a medical doctor with A1 in SSCE English
Generac Spec Writer: From intelligent BIM files to helpful tools that enhance and expedite the design, sizing and spec writing process for today's consulting and specifying engineers,
Write Essay Service: Essay Writing Service Without Freelance Writers from India, Africa and etc. Custom Work, 24/7 Support, 30-Day Free Revision, Min.Deadline 6 Hour.
Custom My Paper: Additionally, we check each custom paper for plagiarism to make sure it's original and has references that are properly cited. Super essay writers.
Order My Essay: Need an essay writer who is native English speaking? When you say "Write my essay for me!" our essay ... PLACE ORDER REQUEST QUOTE. We do it all.
Не ми приема cin.ignor() функциятя. Вкарал съм библиотеките #include <ios> и #include <limits>, но пак не става.
Изписва ми следната грешка:bazoocam
Error C2039 'ignor': is not a member of 'std::basic_istream<char,std::char_traits<char>>'
Да не би да ми трябва друга библиотека?
Не признавам работата на cin.ignor (). Имам интегрирани библиотеки #include <ios> и #include <limits>, но не работи.
Получавам свързана грешка: bazoocam
Гаф C2039 „игнориране“: не „полово предавани omegle tv болести :: basic_istream <char, полово предавани болести :: char_traits <char>>“
Имам ли нужда от друга ometv библиотека?