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 1295. Crazy Notions

Compilation Error (C#)
Posted by Black^n^White 30 Jan 2007 15:23
It runs well on MS Visual C# 2005, but here i get CE

using System;
using System.Text;

class Program
{
    static void Main()
    {
        ulong n = ulong.Parse(Console.ReadLine());
        ulong sum = 1;
        ulong ans = 0;
        ulong a = 2, b = 3, c = 4;
        ulong a1 = 1, b1 = 1, c1 = 1;
        for (ulong i = 1; i <= n; ++i)
        {
            a1 *= a;
            a1 %= 1000;
            b1 *= b;
            b1 %= 1000;
            c1 *= c;
            c1 %= 1000;
        }
        sum += a1 + b1 + c1;

        while (true)
        {
            if ((sum % 10) == 0)
            {
                ans++;
            }
            else
            {
                Console.WriteLine(ans);
                break;
            }
            sum /= 10;
        }
    }
}

Edited by author 30.01.2007 15:26
Re: Compilation Error (C#)
Posted by Akob 21 Mar 2007 14:22
Say you what you write on c#

Edited by author 21.03.2007 14:23
Re: Compilation Error (C#)
Posted by [SPbSU ITMO] Dennis Yolkin 21 Mar 2007 16:33
Really compilation error? I sent your solution for problem 1000 and it was compiled (I got crash on 1 test). Be sure that you selected correct langyage during submitting

Edited by author 21.03.2007 16:47
Re: Compilation Error (C#)
Posted by Razvan Brezulianu 27 Aug 2007 15:34
man put instead of true sum != 0