Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我写的答案一样啊,为什么WA??帮帮忙

Posted by 04369086 at 2006-09-04 15:19:04 on Problem 1488
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator