例题4-1 uva Ancient Cipher
来源:互联网 发布:淘宝开店需要花钱吗 编辑:程序博客网 时间:2024/05/19 07:26
书上例题。。。主要是学习下sort 的用法 之前用的都是qsort
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;char a[104],b[104];int cnt1[26],cnt2[26];int main (){while (scanf("%s%s",a,b)==2){memset(cnt1,0,sizeof(cnt1));memset(cnt2,0,sizeof(cnt2));int i,flag=1;for(i=0;i<strlen(a);i++){cnt1[a[i]-'A']++;cnt2[b[i]-'A']++;}sort(cnt1,cnt1+26);sort(cnt2,cnt2+26);for(i=0;i<26;i++){if(cnt1[i]!=cnt2[i]){flag=0;break;}}if(flag==0)printf("NO\n");else if(flag==1)printf("YES\n");memset(a,'\0',sizeof(a));memset(b,'\0',sizeof(b));}return 0;}
0 0
- 例题4-1 uva Ancient Cipher
- 例题 4-1 古老的密码(Ancient Cipher) UVa 1339
- 例题4-1 UVa1339 Ancient Cipher
- UVA 1339 - Ancient Cipher
- uva 1339 Ancient Cipher
- Uva - 1339 - Ancient Cipher
- UVA 1339 - Ancient Cipher
- UVa:1339 Ancient Cipher
- UVA 1339 - Ancient Cipher
- UVA-1339 - Ancient Cipher
- UVa 1339 Ancient Cipher
- UVa 1339 Ancient Cipher
- UVa 1339 - Ancient Cipher
- UVa 1339 - Ancient Cipher
- uva 1339Ancient Cipher
- UVa 1339 - Ancient Cipher
- Uva 1339 - Ancient Cipher
- 【Uva 1339】 Ancient Cipher
- 天空好大,我顶多算是地表上的一粒沙!
- unity3D技术之对话框的制作
- 去除Eclipse下的JS引入报错
- Android自定义View------带删除功能的EditText
- hdu4360 As long as Binbin loves Sangsang spfa变形
- 例题4-1 uva Ancient Cipher
- poj 1062 最短路
- 根据WSDL生成代码可以设置生成的字段类型
- android-gradle-深入浅出-五:build type
- MapServer6.4.1教程学习--CGI变量和用户接口(2-0)
- 挂牵是苦痛而凄美的
- 1-26工作日志
- js 调试
- 数据库SQL基本语法