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

Test #2
Posted by enick 2 Mar 2008 12:23
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;

 }
Re: Test #2
Posted by ddRoot 2 Mar 2008 15:29
Re: Test #2
Posted by ddRoot 2 Mar 2008 15:31
HELLO. WORLD
Right answer is:
Hello. World
Your program prints:
Hello. world
Re: Test #2
Posted by enick 4 Mar 2008 20:26
Thank you