寒假训练--字符串--串结构练习——字符串匹配
2014-02-11 14:27
176 查看
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int l ;
char str1[300] , str2[300] ;
while(scanf("%s%s", str1,str2)!=EOF)
{
l = strlen(str1);
if(l >= 110)
{
str1[110] = '\0' ;
printf("%s\n", str1);
continue;
}
strcat(str1,str2);
str1[110] = '\0' ;
printf("%s\n", str1);
}
}
#include <stdlib.h>
#include <string.h>
int main()
{
int l ;
char str1[300] , str2[300] ;
while(scanf("%s%s", str1,str2)!=EOF)
{
l = strlen(str1);
if(l >= 110)
{
str1[110] = '\0' ;
printf("%s\n", str1);
continue;
}
strcat(str1,str2);
str1[110] = '\0' ;
printf("%s\n", str1);
}
}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int l ; char str1[300] , str2[300] ; while(scanf("%s%s", str1,str2)!=EOF) { l = strlen(str1); if(l >= 110) { str1[110] = '\0' ; printf("%s\n", str1); continue; } strcat(str1,str2); str1[110] = '\0' ; printf("%s\n", str1); } }
相关文章推荐
- 寒假训练--图的基本知识--图结构练习——BFSDFS——判断可达性
- 寒假训练--图的基本知识--图结构练习——BFS——从起始点到目标点的最短步数
- 寒假训练2018.2.2训练日志------贪心基础题目练习总结(二)
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接 解题报告
- (编程训练)再回首,数据结构——字符串操作
- 串结构练习——字符串连接
- 串结构练习――字符串连接 解题报告
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- sdut oj2124 串结构练习——字符串连接(动态开辟字符数组)
- 寒假训练--二分哈希--数据结构上机实验之二分查找
- 寒假训练--二分哈希--数据结构实验:哈希表
- SDUTOJ(2124)串结构练习——字符串连接
- 【2124】串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 2018年全国多校算法寒假训练营练习比赛(第五场)C 字符串的问题
- 串结构练习——字符串连接