Code: Select all
Removed after accepted
Moderator: Board moderators
Code: Select all
Removed after accepted
Code: Select all
#include <iostream>
using namespace std;
int main(){
char str[2000];
char k=1;
while(cin){
cin.getline(str, 2000);
for(int i=0; str[i]!= '\0' ; i++){
if(str[i]=='"'){
if(k%2==1) cout<<"``";
else cout<<"''";
k++;
}
else cout<<str[i];
}
cout<<endl;
}
return 0;
}
Code: Select all
char k=1;
Code: Select all
int k=1;
Bluefin wrote:I do not understand why you write this:it should be like this:Code: Select all
char k=1;
modify it and you'll get ACC. I have already tried it and the program got ACC immediately !!Code: Select all
int k=1;
Good Luck !!
Thank you very much! it could be accepted.
and may i have another question?
"Warning: Your program would get a Presentation Error in a true contest.
The 24-hours judge interpretes it as an "Accepted" problem.
"
what did it mean?
You get PE for this problem. It means your answer is correct, but your format has some small errors !!Thank you very much! it could be accepted.
and may i have another question?
"Warning: Your program would get a Presentation Error in a true contest.
The 24-hours judge interpretes it as an "Accepted" problem.
"
what did it mean?
Code: Select all
``To be or not to be,'' quoth the Bard, ``that
is the question''.
The programming contestant replied: ``I must disagree.
To `C' or not to `C', that is The Question!''
--------> there is a blank line, please delete it !!
Code: Select all
while(cin){
cin.getline(str, 2000);
Code: Select all
while(cin.getline(str, 2000))
Code: Select all
the code is removed after ac.
Code: Select all
"I am mr newton". "are you ish?
n" nothing' to be worried" " ".
Code: Select all
``i am mr newton''. ``are you ish?
n'' nothing' to be worried`` '' ``.
Code: Select all
#include <stdio.h>
#include <string.h>
int main()
{
int i;
int k;
int count;
char sl[2000];
while( gets(sl) != EOF )
{
k = strlen(sl);
count = 0;
for(i=0;i<k;i++)
{
if((sl[i] == '"') && (count%2 == 0) )
{
printf("``");
count++;
}
else if((sl[i] == '"') && (count%2 != 0) )
{
printf("''");
count++;
}
else
{
printf("%c",sl[i]);
}
}
printf("\n");
}
return 0;
}
Code: Select all
#include <stdio.h>
#include <string.h>
int main()
{
int i;
int k;
int count;
char sl[2000];
while( gets(sl) != NULL )
{
k = strlen(sl);
count = 0;
for(i=0;i<k;i++)
{
if((sl[i] == '"') && (count%2 == 0) )
{
printf("``");
count++;
}
else if((sl[i] == '"') && (count%2 != 0) )
{
printf("''");
count++;
}
else
{
printf("%c",sl[i]);
}
}
printf("\n");
}
return 0;
}
Code: Select all
removed
}