10252 - Common Permutation
来源:互联网 发布:mac上的网络游戏 编辑:程序博客网 时间:2024/04/27 16:59
题意:按字典序输出二个字符串相同的元素
算法:hash标记
连接:点击打开链接
#include <stdio.h>int main ( ){char str[1005], ch[1005];while ( gets ( str ) ){gets ( ch );int hash[26] = { 0 }, visit[26] = { 0 }, i = 0;while ( str[i] )hash[str[i++]-'a']++;i = 0;while ( ch[i] )visit[ch[i++]-'a']++;for ( i = 0; i < 26; i++ ){int x = hash[i] > visit[i] ? visit[i] : hash[i];while ( x-- )printf ( "%c", i + 'a' );}puts ( "" );}return 0;}
- uva-10252-Common Permutation
- UVa 10252 Common Permutation
- uva 10252Common Permutation
- 10252 - Common Permutation
- Uva 10252 - Common Permutation
- UVa 10252 - Common Permutation
- UVA--10252 Common Permutation
- Uva OJ 10252 - Common Permutation
- 6 UVA 10252 Common Permutation
- 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.)
- pku 2629 Common permutation
- poj 2629 Common permutation
- uva10252 Common Permutation
- Linux相关-------简单工程Makefile的编写
- 最大公约数
- C++ 笔记
- GPS NMEA-0183协议详解
- 简单爱你
- 10252 - Common Permutation
- Linux相关-------简单工程Makefile的自动生成
- 单片说明中定义数组空间不足解决
- VC++学习笔记(五)
- iPhone上实现流媒体播放器
- 九度1018
- VC++学习笔记(六)
- OPENCV haarcascade文件解析
- F1论坛快速回复工具...