i downloaded the solved code for problem reverse string from scoreboards of
winner that was
#include <stdio.h>
#include <string.h>
int main()
{
int t,j,k,i,n;
char x[1010];
freopen("in","r",stdin);
freopen("B.out","w",stdout);
scanf("%d",&t);
for(k=0;k<t;++k) {
scanf("\n%[^\n]",x);
n = strlen(x);
printf("Case #%d:",k+1);
while(n>=0) {
for(i=n-1;i>=0;--i)
if(x[i] == ' ') break;
printf(" ");
for(j=i+1;j<n;++j) printf("%c",x[j]);
n = i;
}
printf("\n");
}
}
but, when i m submitting that ,, i get error your output should start with
case #1: , even though it's correct. plz help. the code posted is of the
winners of code jam 2010 . there code is showing this error on my macbook,
safari browser. what's da reason..
On Thu, May 5, 2011 at 11:09 PM, Rahul Gulati <[email protected]>wrote:
> Use wordpad on windows to open the file and copy the contents to a new text
> file.
>
> On Thu, May 5, 2011 at 11:01 PM, chase <[email protected]> wrote:
>
>> when i m downloading the input text file on my macbook , it is
>> displaying as :::
>>
>>
>> 10
>> 100
>> 2
>> 445 5476 67
>> 545 545
>> 3
>> 44 45545
>>
>>
>>
>> but when i m downloading in my window laptop , the downloaded input
>> file is showing as :::
>>
>>
>>
>> 10 100 2 445 5476 67 545 545 3 44 45545
>>
>>
>>
>>
>> plz tell which input file i will prefer for programming ,,, in
>> windows there's no newline \n , but in macbook it is \n newline . plz
>> suggest . fast
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>
>
> --
> Rahul Gulati
> [email protected]
> Department of Computer Science
> Jaypee Institute of Information Technology (Deemed University)
> India
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.