Chinaunix首页 | 论坛 | 博客
  • 博客访问: 125208
  • 博文数量: 31
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 275
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-08 15:00
文章分类

全部博文(31)

文章存档

2009年(15)

2008年(16)

我的朋友

分类: C/C++

2009-03-19 10:19:41

#include
#include
using namespace std;
#define max 101
int ascii1[128]={0},ascii2[128]={0};
char str1[max], str2[max];
int main()
{
 freopen("input.txt","r",stdin);
 while(EOF!=scanf("%s",str1))
 {
  scanf("%s",str2);
  for(size_t i=0; i  {
   ascii1[str1[i]]++;
   ascii2[str2[i]]++;
  }
  sort(ascii1,ascii1+128);
  sort(ascii2,ascii2+128);
  bool flag = true;
  for(size_t i = 0; i<128; ++i)
  {
   if(ascii1[i]!=ascii2[i])
   {
    flag = false;
    break;
   }
  }
  if(flag)
   cout<<"YES"<  else
   cout<<"NO"<  memset(str1,0,max);
  memset(str2,0,max);
 }
 return 0;
}
阅读(1475) | 评论(0) | 转发(0) |
0

上一篇:ACM POJ 3299

下一篇:Windows NT Windows 95 区别

给主人留下些什么吧!~~