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 1601. AntiCAPS

Why I got "Crash (access violation)" on 1st test?
Posted by Lyzhin Vladimir (Orenburg SU) 16 Mar 2008 16:22
What C# compiler is used on the server?
It is my source:

/* Timus Online Judge
 * Задача 1601. АнтиКАПС
 * */

using System;
using System.Text;

internal class Task_1601
{
  private static StringBuilder message;

  public static void Main( )
  {
    Input( );
    Solve( );
    Output( );
  }

  private static void Input( )
  {
    message = new StringBuilder( );
    string s = null, t;
    bool MakeCapitalLetters = true;
    while ( s != "" )
    {
      s = Console.ReadLine( );
      for ( int i = 0; i < s.Length; ++i )
      {
        t = s[ i ].ToString( );
        if ( MakeCapitalLetters && s[ i ] != ' ' )
        {
          message.Append( t );
          MakeCapitalLetters = false;
        }
        else
        {
          if ( s[ i ]== '.' || s[ i ]=='!' || s[ i ]=='?' )
          {
            MakeCapitalLetters = true;
          }
          message.Append( t.ToLower( ) );
        }
      }
      message.AppendLine( );
    }
  }

  private static void Solve( )
  {
  }

  private static void Output( )
  {
    Console.Write( message );
  }
}

Excuse me for my English.

Edited by author 16.03.2008 16:35