272 - TEX Quotes

All about problems in Volume 2. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

ernest
New poster
Posts: 7
Joined: Fri Feb 13, 2004 5:01 pm

272 - compiler error

Post 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,
--ernesto

playerX
Learning poster
Posts: 63
Joined: Fri Apr 25, 2003 11:57 pm
Location: Coimbra, Portugal

Post 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...
be cool...

ernest
New poster
Posts: 7
Joined: Fri Feb 13, 2004 5:01 pm

Post 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,
--ernesto

playerX
Learning poster
Posts: 63
Joined: Fri Apr 25, 2003 11:57 pm
Location: Coimbra, Portugal

Post 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.
be cool...

thinker
New poster
Posts: 4
Joined: Mon Mar 28, 2005 8:38 pm

i got WA in 272!! help PLZ

Post 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;

}

anisalamgir
New poster
Posts: 6
Joined: Sat Jul 09, 2005 10:18 am
Location: Daffodil International University,Dhaka
Contact:

272 why PE?

Post by anisalamgir »

any body help me??
my code here............................

Code: Select all

CUT AFTER AC............................
}
:oops:
pls help me..............
Last edited by anisalamgir on Wed Oct 12, 2005 9:20 am, edited 1 time in total.
anis alamgir

sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

\n

Post by sohel »

remove the new line at the end.
.. and the code. :wink:

anisalamgir
New poster
Posts: 6
Joined: Sat Jul 09, 2005 10:18 am
Location: Daffodil International University,Dhaka
Contact:

Re: \n

Post by anisalamgir »

sohel wrote:remove the new line at the end.
.. and the code. :wink:
a lot of thanks for ur help.....
now i get AC :lol:
anis alamgir

yogeshgo05
New poster
Posts: 47
Joined: Sun Nov 27, 2005 12:43 pm

272 -- wa help

Post 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;
}

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo »

Code: Select all

a[0]=96; 
a[1]=96; 
cout<<a; 
check this out..
"a" should be null terminated string..

Donotalo
Learning poster
Posts: 56
Joined: Sat Aug 20, 2005 11:05 am
Location: Bangladesh

272 - Compile Error

Post 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?
Image

Tanu
Learning poster
Posts: 70
Joined: Sun May 29, 2005 12:46 pm
Location: Mars

Compiler error

Post 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...

sml
New poster
Posts: 15
Joined: Mon Jul 24, 2006 3:34 pm

272 PE

Post 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. :D

Thanks anyway guys.

sml
New poster
Posts: 15
Joined: Mon Jul 24, 2006 3:34 pm

Post 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()).

Tanu
Learning poster
Posts: 70
Joined: Sun May 29, 2005 12:46 pm
Location: Mars

But I used

Post by Tanu »

I used
c = getchar() for this problem

Post Reply

Return to “Volume 2 (200-299)”