| ||||||||||
| 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:哪位大牛帮忙看一下啊?为什么WA???In Reply To:哪位大牛帮忙看一下啊?为什么WA??? Posted by:zhenjie at 2009-05-13 08:55:00 > #include <stdio.h>
> #include<string.h>
> int main()
> {
> char a[150],b[150]; /*特意开大点的数组*/
> int i,ca[26]={0},cb[26]={0},ta[20]={0},tb[20]={0};
> gets(a);
> gets(b);
> for(i=0;i<=strlen(a)-1;i++)
> {
> ca[a[i]-65]++;
> }
> for(i=0;i<=strlen(b)-1;i++)
> {
> cb[b[i]-65]++;
> }
> for(i=0;i<=25;i++)
> {
> ta[ca[i]]++;tb[cb[i]]++;
> }
> for(i=0;i<=19;i++)
> {
> if(ta[i]!=tb[i])
> {printf("NO\n");break;}
> }
> if(i==20)
> printf("YES\n");
> return 1;
> }
我也这么做的,wa,不明白
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator