Uva 10252 - Common Permutation
来源:互联网 发布:淘宝竞争定位分析 编辑:程序博客网 时间:2024/04/27 14:34
计数转化下
取两字串的最小
输出
ok
1Y
#include<stdio.h>#include<string.h>#include<algorithm>char a[10010],b[10010];int main(){while(gets(a)!=NULL){gets(b);int la=strlen(a);int lb=strlen(b);int i;int xa[30],xb[30];memset(xa,0,sizeof(xa));memset(xb,0,sizeof(xb));for(i=0;i<la;i++)if(a[i]>='a'&&a[i]<='z')xa[a[i]-'a']++;for(i=0;i<lb;i++)if(b[i]>='a'&&b[i]<='z')xb[b[i]-'a']++;for(i=0;i<26;i++){int l=std::min(xa[i],xb[i]);for(int j=1;j<=l;j++)printf("%c",'a'+i);}printf("\n");}return 0;}
- uva-10252-Common Permutation
- UVa 10252 Common Permutation
- uva 10252Common Permutation
- Uva 10252 - Common Permutation
- UVa 10252 - Common Permutation
- UVA--10252 Common Permutation
- Uva OJ 10252 - Common Permutation
- 6 UVA 10252 Common Permutation
- UVa Problem Solution: 10252 - Common Permutation
- PC/UVa 110303/10252 Common Permutation
- uva 10252 - Common Permutation 字符串水题
- Uva 10252 Common Permutation 公共排序
- UVa 10252 Common Permutation (water ver.)
- UVa Problem 10252 Common Permutation (公共排列)
- 字符串 UVa 10252 Common Permutation (公共排列)
- 10252 - Common Permutation
- Common Permutation
- (字符串的处理4.7.14)UVA 10252 Common Permutation(寻找两个字符串中的共同字符&&按字典序输出)
- Uva 408 - Uniform Generator
- 变形课
- UVA 10127
- 孙子兵法之用间篇
- jQuery 简单表单传值
- Uva 10252 - Common Permutation
- 使用jQuery+HttpHandler+xml模拟一个三级联动的例子
- HDU1282:回文数猜想
- pthread_rwlock读写锁的使用细节
- 科目辅助核算被修改导致对账不平的问题
- Uva 10714 - Ants
- HttpHandler HttpModule入门篇
- no swt-win32-3236 in java.library.path异常解决方案
- HttpHandler开发的两个重点问题