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

Common Board

Runtime Error What's wrong?
Posted by олька 31 Jul 2013 16:04
using System;



namespace ConsoleApplication4
{
    class Program
    {
        static void Main()
        {  int x = 1;
            do
                        {
                Console.WriteLine("введите число");
                String строка = Console.ReadLine();
                Single X;
                X = Single.Parse(строка);
                {
                    if (X <= 4 && X >= 1 )
                    {   Console.WriteLine(" few");}
                         if( X <= 9 && X >= 5)
                         {   Console.WriteLine("several");
                    }
                    if (X <= 19 && X >= 10 )
                    {Console.WriteLine("pack");}
                          if( X <= 49 && X >= 20)
                          {  Console.WriteLine("lots");}
                          if (X <= 249 && X >= 100)
                          { Console.WriteLine("throng"); }
                          if (X <= 99 && X >= 50)
                          { Console.WriteLine("horde"); }
                          if (X <= 499 && X >= 250)
                          { Console.WriteLine("swarm"); }
                          if (X <= 999 && X >= 500)
                          { Console.WriteLine("zounds"); }
                          if (  X <= int.MaxValue   && X >= 1000 )
                          { Console.WriteLine("legion"); }
                    }
                }
            while (x != 0);
        }
    }
}
Re: Runtime Error What's wrong?
Posted by r1d1 2 Aug 2013 01:59
using System;



namespace ConsoleApplication4
{
    class Program
    {
        static void Main()
        {
            int x = 1;
            String строка = Console.ReadLine();
            Single X;
            X = Single.Parse(строка);
            {
                if (X <= 4 && X >= 1)
                { Console.WriteLine("few"); }
                if (X <= 9 && X >= 5)
                {
                    Console.WriteLine("several");
                }
                if (X <= 19 && X >= 10)
                { Console.WriteLine("pack"); }
                if (X <= 49 && X >= 20)
                { Console.WriteLine("lots"); }
                if (X <= 249 && X >= 100)
                { Console.WriteLine("throng"); }
                if (X <= 99 && X >= 50)
                { Console.WriteLine("horde"); }
                if (X <= 499 && X >= 250)
                { Console.WriteLine("swarm"); }
                if (X <= 999 && X >= 500)
                { Console.WriteLine("zounds"); }
                if (X <= int.MaxValue && X >= 1000)
                { Console.WriteLine("legion"); }
            }
        }
    }
}