#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的更多相关文章

  1. poj 2681 字符串

    http://poj.org/problem?id=2681 给你任意长度的字符串,找出两串字符中不相同的字符个数(总数) #include<string> #include<cst ...

  2. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  3. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  4. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  5. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  6. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

  7. POJ 2739. Sum of Consecutive Prime Numbers

    Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050 ...

  8. POJ 2255. Tree Recovery

    Tree Recovery Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11939   Accepted: 7493 De ...

  9. 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 ...

随机推荐

  1. SELECT INTO创建临时表

    SELECT INTO创建临时表 SQL Server临时表有两种类型:本地和全局.它们在名称.可见性以及可用性上有区别.本地临时表的名称以单个数字符号 (#) 打头:它们仅对当前的用户连接是可见的: ...

  2. kmp算法笔记

    https://blog.csdn.net/v_july_v/article/details/7041827#comments 链接讲得很详细,画几个重点方便以后忘了捡 next[]数组从第i位递推算 ...

  3. 解决设置select默认选中不生效的方法

    $scope.storageTypeList = ['Glusterfs','NFS','Ceph']; 不生效的方法: <select class="form-control&quo ...

  4. ubuntu上安装win7系统(64位的)

    http://www.linuxidc.com/Linux/2012-11/74195.htm deb文件在ubuntu上直接用dpkg -i xxx.deb 如果虚拟机上只显示32位,则可能是cpu ...

  5. Mybatis-Plus 实战完整学习笔记(十一)------条件构造器删除,修改,conditon

    1.修改功能--其他过滤方式跟select一样 /** * 修改条件构造器 * @throws SQLException */ @Test public void selectUpdate() thr ...

  6. UVa 11021 Tribles (概率DP + 组合数学)

    题意:有 k 只小鸟,每只都只能活一天,但是每只都可以生出一些新的小鸟,生出 i 个小鸟的概率是 Pi,问你 m 天所有的小鸟都死亡的概率是多少. 析:先考虑只有一只小鸟,dp[i] 表示 i 天全部 ...

  7. mouseover和mouseout事件的相关元素

    在发生mouseover和mouseout事件时,还会涉及更多的元素,这两个事件都会涉及把鼠标指针从一个元素的边界之内移动到另一个元素的边界之内.对mouseover事件而言,事件的主目标获得光标元素 ...

  8. 安卓修改开机logo

    这里我们是在ubuntu下进行操作我是用root用户登陆的,首先安装netpbm库 执行:apt-get install netpbm 对于Android系统最开始表现logo是在内核当中,所以首先我 ...

  9. progress 进度条

      进度条.  属性名 类型 默认值 说明 percent Float 无 百分比0~100 show-info Boolean false 在进度条右侧显示百分比 stroke-width Numb ...

  10. Write Markdown Syntax Online Document with Sphinx and Pandoc

    There is no doubt that we have to write doc while we are developing software. But How do you write d ...