UVa 10887 - Concatenation of Languages
来源:互联网 发布:先锋软件职业技术学院 编辑:程序博客网 时间:2024/04/30 10:27
特别坑的一道题,特别恶心.因为有的字符串是空的
也就是说 a[i] ="ppp\0", b[i] ="\0", 而 a[i] + b[i] = “ppp\0”,算答案的时候这个也是一种的
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <set>
using namespace std;
char str[100];
char list1[1000][12];
set<string> list2;
int main()
{
int t, n, m;
scanf("%d",&t);
for( int cases = 1; cases <= t; cases++)
{
list2.clear();
scanf("%d %d",&n, &m);
getchar();
char temp[12] = "\0";
char s[12];
char line[25];
for( int i = 0; i < n; i++)
gets(list1[i]);
for( int j = 0; j < m; j++)
{
gets(s);
for( int i = 0; i < n ; i++)
{
strcpy(line,list1[i]);
strcat(line, s);
list2.insert(line);
}
}
printf("Case %d: %d\n", cases, list2.size());
}
return 0;
}
- Uva 10887 Concatenation of Languages
- UVa 10887 - Concatenation of Languages
- uva 10887 - Concatenation of Languages
- UVa 10887 - Concatenation of Languages
- UVA 10887 Concatenation of Languages
- uva 10887 - Concatenation of Languages
- uva 10887 - Concatenation of Languages
- UVA 10887 Concatenation of Languages
- UVa:10887 Concatenation of Languages
- uva 10887Concatenation of Languages
- UVa 10887 - Concatenation of Languages
- UVa 10887 - Concatenation of Languages
- UVA 10887 Concatenation of Languages
- UVA 10887 - Concatenation of Languages
- UVA - 10887 Concatenation of Languages
- UVA - 10887 Concatenation of Languages
- UVa 10887 - Concatenation of Languages
- uva 10887Concatenation of Languages
- java 保留2位小数
- 正则表达式用法及实例
- Train Problem I(STL)基本运用stack
- LeetCode 125. Valid Palindrome
- 常州丰胸手术大概要多少钱
- UVa 10887 - Concatenation of Languages
- cubietruck lubuntu启动信息分析
- java IO流
- 虚拟机小问题解决
- js操作html的table,包括添加行,添加列,删除行,删除列
- Minimum Depth of Binary Tree(leetcode)
- 常州做自体脂肪丰胸多少钱
- [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance
- CocoaPods的安装及使用