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

may be it is ridiculous but please answer
Posted by mhg 2 Jul 2014 19:58
hi,
what is wrong with this code:
#include <iostream>
using namespace std;
int main() {
 int n ;
 cin >> n ;

 if ( n>= 1 && n <= 4)
     cout << "few";
 if ( n>= 5 && n <= 9)
     cout << "several";
 if ( n>= 10 && n <= 19)
     cout << "pack";
 if ( n>= 20 && n <= 49)
     cout << "lots";
 if ( n>= 50 && n <= 99)
     cout << "horde";
 if ( n>= 100 && n <= 249)
     cout << "throng";
 if ( n>= 250 && n <= 499)
     cout << "swarm";
 if ( n>= 500 && n <= 999)
     cout << "zounds";
 if ( n == 1000)
     cout << "legion";
   system ("PAUSE");
}

it seems that there is no error but it dosen't accept.
Re: may be it is ridiculous but please answer
Posted by Narek Tutikyan 5 Jul 2014 14:43
Check the last if. It must must be n >= 1000  .
mhg wrote 2 July 2014 19:58
hi,
what is wrong with this code:
#include <iostream>
using namespace std;
int main() {
 int n ;
 cin >> n ;

 if ( n>= 1 && n <= 4)
     cout << "few";
 if ( n>= 5 && n <= 9)
     cout << "several";
 if ( n>= 10 && n <= 19)
     cout << "pack";
 if ( n>= 20 && n <= 49)
     cout << "lots";
 if ( n>= 50 && n <= 99)
     cout << "horde";
 if ( n>= 100 && n <= 249)
     cout << "throng";
 if ( n>= 250 && n <= 499)
     cout << "swarm";
 if ( n>= 500 && n <= 999)
     cout << "zounds";
 if ( n >= 1000)
     cout << "legion";
   system ("PAUSE");
}

it seems that there is no error but it dosen't accept.
Re: may be it is ridiculous but please answer
Posted by mhg 7 Jul 2014 17:39
thanks man,