1 / 3
Mar 2013

Hello everyone,
First, please excuse my poor English.

I'm really new to programming and spoj.com. I tried to do the Doughnut Problem, but i failed frowning.

I think the main Problem for me is how to use the input. I did it that way, but there is an compiling error.

I would be glad if someone could help me.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Doughnut
{
    class Program
    {
        static void Main(string[] args)
        {
            int c,k,w;
            string ausgabe="";
            int t = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < t; i++)
            {
                string x = Console.ReadLine();
                string[] xa = x.Split(' ');
                c = Convert.ToInt32(xa[0]);
                k = Convert.ToInt32(xa[1]);
                w = Convert.ToInt32(xa[2]);
                if (c * w <= k)
                ausgabe = ausgabe + "yes"+ "\r\n";
            else
                ausgabe = ausgabe + "no" + "\r\n";


        }
        Console.WriteLine(ausgabe);
       
                                                 

        
    }
}
}
  • created

    Mar '13
  • last reply

    Mar '13
  • 2

    replies

  • 957

    views

  • 2

    users

What does the compiler error say? If you click where it says "Compiler Error" it will explain itself.

What compiler are you using locally? Are you using the same one as SPOJ?

Have you solved TEST? There is a sample solution up higher in the forum.

Hello leppy,

ty for your answer. The "compiler error" explained the problem, I used namespace, which are very new in C#. The compiler of SPOJ had problems with them.

Thank you very much!