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

谁能告诉我哪里错了啊???????????????????

Posted by yanzhu at 2009-03-21 12:54:53 on Problem 1458
#include<iostream>
using namespace std;
int main()
{
	int i,j,s;
	char c1[100],c2[100];
	//cin>>n;
	
	cin>>c1>>c2;

	while(1)
	{	cout<<endl;
		
		i=0;
		while(c1[i]!='\0')
			i++;
			
		j=0;
		while(c2[j]!='\0')
			j++;

		s=0;
	for(int x=0;x<i;x++)
		for(int y=0;y<j;y++)
			if(c1[x]==c2[y]&&c1[x]!='0'&&c2[y]!='0')
			{
				s++;
				for(int p=x+1;p<i;p++)
					if(c1[p]==c1[x])
						c1[p]='0';

			for(int q=y+1;q<j;q++)
					if(c2[q]==c2[y])
						c2[q]='0';

				c1[x]='0';
				c2[y]='0';
			}

		
	
				cout<<s<<endl;
				if(s==0)
				        break;
				else
		           cin>>c1>>c2;
		
	}
	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