| ||||||||||
| 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<stdio.h>
#define N 4
char a[N],b[N];
int main()
{
int testcase;
scanf("%d",&testcase);
while(testcase--)
{
int s=0,d=0;
scanf(" %s %s",a,b);
int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
{
if(i==j&&a[i]==b[j])
s++;
else if(i!=j&&a[i]==b[j])
d++;
}
printf("%dA%dB\n",s,d);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator