272 - TEX Quotes
Moderator: Board moderators
272 - compiler error
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,
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
No I'm not using anything of that, its standard pascal only,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...
I got 10 CE!! Thats abnormal! I think the judge was knocked down jeje.
thanks for your reply,
--ernesto
i got WA in 272!! help PLZ
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;
}
#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;
}
-
- New poster
- Posts: 6
- Joined: Sat Jul 09, 2005 10:18 am
- Location: Daffodil International University,Dhaka
- Contact:
272 why PE?
any body help me??
my code here............................
pls help me..............
my code here............................
Code: Select all
CUT AFTER AC............................
}

pls help me..............
Last edited by anisalamgir on Wed Oct 12, 2005 9:20 am, edited 1 time in total.
anis alamgir
-
- New poster
- Posts: 6
- Joined: Sat Jul 09, 2005 10:18 am
- Location: Daffodil International University,Dhaka
- Contact:
Re: \n
a lot of thanks for ur help.....sohel wrote:remove the new line at the end.
.. and the code.
now i get AC

anis alamgir
-
- New poster
- Posts: 47
- Joined: Sun Nov 27, 2005 12:43 pm
272 -- wa help
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;
}

# 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;
}
Code: Select all
a[0]=96;
a[1]=96;
cout<<a;
"a" should be null terminated string..
272 - Compile Error
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
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
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
Gud lack...select any fuction name and press ctrl+F1 if the function is unix supported then it will also be supported in acm.
272 PE
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.
OMG! It was a spare \n at the end of the output! Holy crap this thing is seriously particular.

Thanks anyway guys.
But I used
I used
c = getchar() for this problem
c = getchar() for this problem