| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我写的答案一样啊,为什么WA??帮帮忙#include "stdio.h"
main()
{
char in,out[500];
int i=0,j,flag=0;
scanf("%c",&in);
do{
if(in!='\n')
{
if(in=='"')
{
if(flag==0)
{
out[i]='`';
out[++i]='`';
i++;
flag=1;
}
else
{
out[i]='\'';
out[++i]='\'';
i++;
flag=0;
}
}
else
{
out[i]=in;
i++;
}
}
else
{
for(j=0;j<i;j++)
{
printf("%c",out[j]);
}
printf("\n");
i=0;
}
}while(scanf("%c",&in)!=EOF);
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator