ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1785. Lost in Localization

C++ Help!!!
Posted by Владимир 10 Aug 2018 20:34
Я не понимаю, что здесь не правильного???
#include <iostream>
#include <string>
using namespace std;

int main() {
    string name[] = { "few", "several", "pack", "lots", "horde", "throng", "swarm", "zounds", "legion" };
    int input;
    cin >> input;
    if (input >=1 && input <= 4) cout << name[0];
    if (input > 4 && input <= 9) cout << name[1];
    if (input > 9 && input <= 19) cout << name[2];
    if (input > 19 && input <= 49) cout << name[3];
    if (input > 49 && input <= 99) cout << name[4];
    if (input > 99 && input <= 249) cout << name[5];
    if (input > 249 && input <= 499) cout << name[6];
    if (input > 499 && input <= 999) cout << name[7];
    if (input > 1000) cout << name[8];
    return 0;
}

Подскажите, пожалуйста!
Re: C++ Help!!!
Posted by Andrey135296 8 Sep 2018 20:15
у тебя случай n=1000 никуда не включен.
you forgot n=1000 case.