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 |
Re:怎么可能会出错?In Reply To:怎么可能会出错? Posted by:sunpy at 2008-08-02 17:15:12 > #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; > } 4444 4000 你的程序是返回1A3B吧? Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator