Page 2 of 10
272 - compiler error
Posted: Sat Feb 14, 2004 6:30 pm
by ernest
Hello,
I can't get AC with problem 272, everytime I send the problem I just get CE,
However the program (pascal) compiles without problem in FreePascal and BPascal 7!! What could be possibly happening?
I use the web tool to send the file so I dont think that there is eny problem with that.
Please help!!
best regards,
Posted: Sat Feb 14, 2004 9:38 pm
by playerX
are you using "Uses CRT", w/ function like clrscr; ? Make sure you tag your program using "Program programname;" at the beggining, these stuff could lead to CTE in the judge...
Posted: Sat Feb 14, 2004 11:49 pm
by ernest
playerX wrote:are you using "Uses CRT", w/ function like clrscr; ? Make sure you tag your program using "Program programname;" at the beggining, these stuff could lead to CTE in the judge...
No I'm not using anything of that, its standard pascal only,
I got 10 CE!! Thats abnormal! I think the judge was knocked down jeje.
thanks for your reply,
Posted: Tue Feb 17, 2004 11:16 pm
by playerX
That's strange.. .I used pascal some months ago w/ this judge and didn't get any strange cte...
maybe you could post your code in the pascal section, I'm sure someone will help you.
i got WA in 272!! help PLZ
Posted: Mon Mar 28, 2005 9:56 pm
by thinker
i dont underdtand why i got WA in 272. where is my wrong.
#include<stdio.h>
#include<string.h>
char str[30000];
char a[30000];
int j=1,size;
int main()
{
// freopen("input.in","r",stdin);
while(gets(str)!=NULL)
{
int k=0;
size=strlen(str);
for(int i=0;i<size;i++)
{
if(str!='"')
{
a[k]=str;
k=k+1;
}
else if(str=='"')
{
if((j%2)!=0)
{
a[k]=char(96);
a[k+1]=char(96);
k=k+2;
}
if((j%2)==0)
{
a[k]=char(39);
a[k+1]=char(39);
k=k+2;
}
j=j+1;
}
}
for(int m=0;m<=k;m++)
{
printf("%c",a[m]);
}
for(int l=0;l<=k;l++)
{
a[l]=NULL;
}
printf("\n");
}
return 0;
}
272 why PE?
Posted: Tue Oct 11, 2005 5:10 am
by anisalamgir
any body help me??
my code here............................
Code: Select all
CUT AFTER AC............................
}
pls help me..............
\n
Posted: Tue Oct 11, 2005 2:53 pm
by sohel
remove the new line at the end.
.. and the code.

Re: \n
Posted: Wed Oct 12, 2005 9:18 am
by anisalamgir
sohel wrote:remove the new line at the end.
.. and the code.

a lot of thanks for ur help.....
now i get AC

272 -- wa help
Posted: Sat Jan 28, 2006 2:56 pm
by yogeshgo05
hey guys i dont whats wrong , it works fine, give me some test cases or plz catch the bug
# include <iostream.h>
# include <stdio.h>
int main()
{
char ch;
char a[2];
int count=0;
while((ch=getchar())!=EOF)
{
if(ch=='"')
{
if(count%2==0)
{
a[0]=96;
a[1]=96;
cout<<a;
count++;
}
else
{
a[0]=39;
a[1]=39;
cout<<a;
count++;
}
}
else
{
putchar(ch);
}
}
return 0;
}
Posted: Sat Jan 28, 2006 3:19 pm
by helloneo
check this out..
"a" should be null terminated string..
272 - Compile Error
Posted: Thu Jul 20, 2006 8:08 am
by Donotalo
i used cin >> noskipws >> ch and no compile time error in my compiler. so what is wrong in judge's compiler? the error is, it cannot recognized noskipws! how to fix it?
Compiler error
Posted: Fri Jul 21, 2006 8:26 am
by Tanu
check your id information...
If your automatic mail is on then there have an mail attaching code
& another with result...
In case of Compiler error the line number of error will be mentioned
Check this
select any fuction name and press ctrl+F1 if the function is unix supported then it will also be supported in acm.
Gud lack...
272 PE
Posted: Mon Jul 24, 2006 3:37 pm
by sml
How come this code gets Presentation Error? Is it because I'm using too many standard functions or are just doing something evil that I shouldn't be doing? TIA.
OMG! It was a spare \n at the end of the output! Holy crap this thing is seriously particular.
Thanks anyway guys.
Posted: Mon Jul 24, 2006 3:42 pm
by sml
noskipws doesn't seem to work for me either, but I used getline() for this particular problem. That's how you want to do it anyway... (if you want to work on char *'s just copy the string with c_str()).
But I used
Posted: Tue Jul 25, 2006 2:23 am
by Tanu
I used
c = getchar() for this problem