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

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

Posted by hunt at 2011-02-23 22:14:59 on Problem 1488
In Reply To:我写的答案一样啊,为什么WA??帮帮忙 Posted by:04369086 at 2006-09-04 15:19:04
#include <stdio.h>

char str[1000];

int main()
{
	int first = 0;
	int i;

//	printf("%d\n", '"');

	while(gets(str))
	{
		for(i = 0; str[i] != '\0'; i++)
		{
			if(str[i] == '"')
			{
				if(first == 0) 
				{
					printf("``");
					first = 1;
				}
				else
				{
					printf("''");
					first = 0;
				}
			}
			else
			{
				printf("%c", str[i]);
			}
		}
		printf("\n");
	}
	
	return 0;
}

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