POJ-2159
来源:互联网 发布:开票软件金税盘版名称 编辑:程序博客网 时间:2024/06/08 17:34
#include<iostream>#include<string>#include<memory.h>using namespace std;int alphabet1[26];int alphabet2[26];int main(int argc, char *argv[]){string line1;cin>>line1;memset(alphabet1, 0, 26);string line1Org="";for(int i=0;i<line1.length();i++){alphabet1[line1[i]-'A']++;}string line2;cin>>line2;memset(alphabet2, 0, 26);for(int i=0; i<line2.length(); i++){alphabet2[line2[i]-'A']++;}bool flag=true;for(int i=0; i<26; i++){if(alphabet1[i]!=0){for(int j=0; j<26; j++){if(alphabet1[i]==alphabet2[j]){alphabet2[j]=-1;break;}else{if(j==25){flag=false;break;}}}}if(!flag){break;}}if(flag){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}return 0;}
0 0
- POJ-2159
- POJ 2159
- POJ 2159
- poj 2159
- poj-2159
- poj 2159
- POJ 2159
- POJ-2159
- POJ 2159
- poj 2159
- poj 2159
- poj 2159
- poj 2159
- POJ 2159 字符串加密
- POJ 2159 Ancient Cipher
- [poj] 水题2159
- poj 2159 : Ancient Cipher
- poj 2159 字母映射
- Bootstrap四-菜单、按钮、导航
- JDBC连接数据库
- 求强连通分量之tarjan算法
- iOS 精益编程
- 64位锐捷多网卡、VMWareNat模式、ICS共享破解
- POJ-2159
- 进阶教程:Android 5.0 免 Root 开启中文 Google Now
- BestCoder Round #60 GT and set (dfs)
- Android性能优化典范第3季
- 用C++实现STL容器stack
- 三位数的倒序
- HDU1036 Average is not Fast Enough!(java)
- 求某年某月某日为星期几(蔡勒公式)
- C++设计模式--享元模式【转载】