POJ 2681
#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#define MAXN 50
using namespace std;
char ch1[MAXN];
char ch2[MAXN];
int dig1[MAXN];
int dig2[MAXN];
int main()
{
//freopen("acm.acm","r",stdin);
int num;
char c;
int i;
int j;
int ans;
int len[];
int time;
int place;
int begin;
cin>>num;
getchar();
for(time = ; time <= num; ++ time)
{
ans = ;
memset(dig1,-,sizeof(dig1));
memset(dig2,-,sizeof(dig2));
gets(ch1);
gets(ch2);
len[] = strlen(ch1);
len[] = strlen(ch2);
for(i = ; i < len[]; ++ i)
{
dig1[i] = ch1[i] - 'a';
}
for(i = ; i < len[]; ++ i)
{
dig2[i] = ch2[i] - 'a';
}
//sort(dig2,dig2+len[1]);
//sort(dig1,dig1+len[0]);
begin = ;
for(i = ;i < len[]; ++ i)
{
for(j = ; j < len[]; ++ j)
if(ch1[i] == ch2[j])
{
ch2[j] = '~';
++ ans;
break;
}
}
cout<<"Case #"<<time<<": "<<len[]+len[]-*ans<<endl;
ch1[] = '\0';
ch2[] = '\0';
}
}
POJ 2681的更多相关文章
- poj 2681 字符串
http://poj.org/problem?id=2681 给你任意长度的字符串,找出两串字符中不相同的字符个数(总数) #include<string> #include<cst ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
随机推荐
- D. Three Pieces(dp,array用法,棋盘模型)
https://codeforces.com/contest/1065/problem/D 题意 给你一个方阵,里面的数字从1~nn,你需要从标号为1的格子依次走到标号为nn,在每一个格子你有两个决策 ...
- const修饰指针时应注意的问题
1.指向常量的指针 顾名思义,一个指针指向const对象,则称它为指向常量的指针. ; int* ptr=&a; //错误 const int* ptr=&a; //必须用const来 ...
- C++之输出100-200内的素数
素数(质数) 除了1和它本身以外不再被其他的除数整除. // 输出100--200内的素数 #include<iostream> using namespace std; int m ...
- 【笔记】CSS选择器整理(IE低版本支持性测试)
时间:2015.05.11 参考附件:css选择器.xmind(网友共享) 查看链接:http://www.w3school.com.cn/cssref/css_selectors.asp htt ...
- Forward团队-爬虫豆瓣top250项目-需求分析
一. 需求:1.爬取豆瓣电影top250. 2.获取电影名称,排名,分数,简介,导演,演员. 3.将爬取到的数据保存,以便随时查看. 3.可以将获取到的数据展示给用户. 二. 参考: 豆瓣api参考资 ...
- java类与继承(转载)
关于java的类与继承面链接是一个网友总结的,还有列子我个人觉得很详细 固拿来收藏,需要的朋友可从这里访问: http://www.cnblogs.com/dolphin0520/p/3803432. ...
- http基本概念
- IOS绘图详解
http://blog.163.com/wkyuyang_001/blog/static/10802122820133190545227/
- Vue的配置
一.build:打包的配置文件的文件夹 1.build.js 生产版本的配置文件,一般这个文件我们是不改的 'use strict' //调用检查版本的文件,check-versions的导出直接是 ...
- Poj2296
题意:给定n个点,然后在每个点在一个正方形的上边或者下边的中点,并且所有的正方形等大且不能重叠.求正方形最大的边长是多少. 思路:很明显的二分边长+判定.不过判定要用到2-sat,算是2-sat的入门 ...