|
|
вернуться в форумmay be it is ridiculous but please answer Послано mhg 2 июл 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 Check the last if. It must must be n >= 1000 . 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 Послано mhg 7 июл 2014 17:39 thanks man, |
|
|