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 1293. Eniya

What's wrong?
Posted by Eugene 5 Jul 2012 02:36
Help. What's wrong in this code?

using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int N, A, B;
            do
            {
                Console.Write("ВВедите N: ");
                N = int.Parse(Console.ReadLine());
            } while (N < 1 || N > 100);

            do
            {
                A = int.Parse(Console.ReadLine());
            } while (A < 1 || A > 100);
            do
            {
                B = int.Parse(Console.ReadLine());
            } while (B < 1 || B > 100);

                int R = ((A*B) * 2)*N;
                Console.WriteLine(R);
        }
    }
}
Re: What's wrong?
Posted by Noob 5 Jul 2012 02:39
> Console.Write("ВВедите N: ");
Delete this line. You should not output anything except the answer. Just think how the system can check it otherwise?
Re: What's wrong?
Posted by Eugene 5 Jul 2012 04:01
I deleted that line, but I still get the Crash on the first test(((
Re: What's wrong?
All three numbers are given in the same line. So, when you try to parse it as a single number, it crashes.