| ||||||||||
| 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 | |||||||||
Re:我写的答案一样啊,为什么WA??帮帮忙In Reply To:我写的答案一样啊,为什么WA??帮帮忙 Posted by:04369086 at 2006-09-04 15:19:04 > #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);
> }
好像用数组了的都WA...
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator