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 00448322 at 2005-05-05 13:58:21 on Problem 1458
#include <iostream.h>

void main()
{
	char str1[500],str2[500];
	char temp;
	int judge1,judge2;//判断是否在两个字符串里出现
	int i,j;
	while( cin.peek() != EOF )
	{
		cin>>str1>>str2;
		int count=0;
		for(int k=0;k<26;k++)//从a开始 直到z
		{
			judge1=0;
			judge2=0;
			temp='a'+k;
			for(i=0;str1[i]!='\0';i++)
			{
				if(temp==str1[i])
				{
					judge1=1;
					break;
				}
			}
			for(j=0;str2[j]!='\0';j++)
			{
				if(temp==str2[j])
				{
					judge2=1;
					break;
				}
			}
			if(judge1==1 && judge2==1)
				count++;
		}
		cout<<count<<endl;
	}
}


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