| ||||||||||
| 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 | |||||||||
请问这道题哪里错了呀#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator