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

С#
Posted by TheVoold 18 Apr 2018 23:36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int x;
            x = Convert.ToInt32 (Console.ReadLine());
            if ((x > 1 & x <= 4)
            {
                Console.WriteLine("few");
            }
            if (x > 5 & x<= 9)
            {
                Console.WriteLine("several");
            }
            if (x > 10 & x <= 19)
            {
                Console.WriteLine("pack");
            }
            if (x > 20 & x <= 49)
            {
                Console.WriteLine("lots");
            }
            if (x > 50 & x <= 99)
            {
                Console.WriteLine("horde");
            }
            if (x > 100 & x <= 249)
            {
                Console.WriteLine("throng");
            }
            if (x > 250 & x <= 499)
            {
                Console.WriteLine("swarm");
            }
            if (x > 500 & x <= 499)
            {
                Console.WriteLine("zounds");
            }
            if (x > 1000)
            {
                Console.WriteLine("legion");
            }
        }
    }
}

Да что тут не так?

Edited by author 18.04.2018 23:36

Edited by author 18.04.2018 23:37
Re: С#
Posted by Oleg Baskakov 19 Apr 2018 01:54
У вас везде > вместо >=.
Ну и тут отдельная ошибка if (x > 500 & x <= 499)