|
|
Show all threads Hide all threads Show all messages Hide all messages | No subject | Vladzick | 1601. AntiCAPS | 21 Mar 2008 16:55 | 2 | А че решать полным перебором? так много получится!!! :( | Can there be new lines? (-) | wap | 1601. AntiCAPS | 16 Mar 2008 16:38 | 2 | | Why I got "Crash (access violation)" on 1st test? | Lyzhin Vladimir (Orenburg SU) | 1601. AntiCAPS | 16 Mar 2008 16:22 | 1 | 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 | Why I got WA!! Test #1 | Varoon | 1601. AntiCAPS | 15 Mar 2008 20:48 | 1 | #include<stdio.h> char in[1000]; int l,a; int main() { gets(in); for(l=0;in[l]!=NULL;l++) { if(in[l]>=65&&in[l]<=90) { if(a==0) { printf("%c",in[l]); a=1; } else { printf("%c",in[l]+32); } } else { if(in[l]==32) { printf(" "); } else { if(in[l]=='.'||in[l]=='!'||in[l]=='?') { printf("%c",in[l]); a=0; } else { printf("%c",in[l]); a=1; } } } } return 0; } Edited by author 15.03.2008 20:49 Edited by author 15.03.2008 20:54 | Test #2 | prtest | 1601. AntiCAPS | 6 Mar 2008 19:49 | 1 | Why I got WA? #include<iostream> using namespace std; int main() { int newsen=1,i,l; char str[99999]; while(cin.getline(str,255)) { l=strlen(str); for(i=0;i<l;i++) { if(str[i]<=64 || str[i]>=91) { if(str[i]!='!' && str[i]!='?' && str[i]!=':' && str[i]!=',' && str[i]!='-' && str[i]!='.' && str[i]!=' ') continue; cout<<str[i]; if(str[i]=='.' || str[i]=='?' || str[i]=='!') newsen=1; continue; } if(newsen==1) { cout<<str[i]; newsen=0; }else cout<<(char)(str[i]+32); } cout<<endl; } //system("pause"); return 0; } | to Admins | Ignat Zakrevsky | 1601. AntiCAPS | 5 Mar 2008 18:50 | 2 | В английском языке местоимение I всегда пишется с большой буквы, это как-то влияет на тесты? No (-) Sandro (USU) 5 Mar 2008 18:50 | Test #2 | enick | 1601. AntiCAPS | 4 Mar 2008 20:26 | 4 | What is wrong: #include <stdio.h> #include <string.h> int i,j,k,flag; char last; char a[10001]; int main() { last='.'; while(gets(a)!=NULL) { for (i=0;i<strlen(a);i++) { if (last!='?'&&last!='!'&&last!='.') if (a[i]>='A'&&a[i]<='Z') a[i]+=32; last=a[i]; } for (i=0;i<strlen(a);i++) printf("%c",a[i]); printf("\n"); } return 0;
}
HELLO. WORLD Right answer is: Hello. World Your program prints: Hello. world | what is test #4 | sahand | 1601. AntiCAPS | 2 Mar 2008 19:11 | 1 | |
|
|
|