| ||||||||||
| 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>
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator