字符串 UVa 10252 Common Permutation (公共排列)
来源:互联网 发布:中京域名交易中心 编辑:程序博客网 时间:2024/04/27 16:29
UVa 10252 Common Permutation
水题一枚, 找出两串中相同的每一个字符, 按字典序排列输出即可
#include <iostream>using namespace std;#include <algorithm>#include <stdio.h>#include <string.h>char a[1005];char b[1005];char c[1005];int main(){ while (gets(a) != NULL && gets(b) != NULL) {memset(c, 0, sizeof(c));int t = 0;for (int i = 0; i < strlen(a); i ++){ for (int j = 0; j < strlen(b); j ++) {if (a[i] == b[j]){ c[t ++] = a[i]; b[j] = '*'; break;} }}c[t] = '\0';sort(c, c + t);printf("%s\n", c); } return 0;}
- 字符串 UVa 10252 Common Permutation (公共排列)
- UVa Problem 10252 Common Permutation (公共排列)
- Uva 10252 Common Permutation 公共排序
- uva 10252 - Common Permutation 字符串水题
- 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 (water ver.)
- UVa 11027 - Palindromic Permutation(排列编码)
- (字符串的处理4.7.14)UVA 10252 Common Permutation(寻找两个字符串中的共同字符&&按字典序输出)
- 最长公共字符串(Longest Common Substring)
- SEDA介绍与分析
- 最大字段和模版(一维)
- ubuntu13.04 wifi连接不上解决
- SRM 584
- FTP中PORT方式和PASV方式
- 字符串 UVa 10252 Common Permutation (公共排列)
- iOS: NSData的方法initWithBytesNoCopy:length:
- android开发系列之三——-android 目录结构
- 最大字段和模版(二维)
- BOE系统与BW系统间的单点登录
- hdu 2896 病毒侵袭(AC自动机,3级)
- Python try-except-else 语句
- 多线程编程问题
- jQuery EasyUI DataGrid Checkbox 数据设定与取值