串结构练习——字符串连接
来源:互联网 发布:大数据 图书 编辑:程序博客网 时间:2024/05/30 04:52
Problem Description
给定两个字符串string1和string2,将字符串string2连接在string1的后面,并将连接后的字符串输出。
连接后字符串长度不超过110。
Input
输入包含多组数据,每组测试数据包含两行,第一行代表string1,第二行代表string2。
Output
对于每组输入数据,对应输出连接后的字符串,每组输出占一行。
Example Input
123654abssfg
Example Output
123654abssfg
Hint
#include<bits/stdc++.h>using namespace std;char Concat(char s1[], char s2[]){ char *p; p = s1; while(*p) p++; while(*s2) { *p = *s2; p++; s2++; } *p = *s2; return s1[0];}int main(){ char s1[120], s2[120]; while(~scanf("%s%s",s1,s2)) { Concat(s1,s2); printf("%s\n", s1); } return 0;}
阅读全文
0 0
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- 串结构练习——字符串连接
- HDU 6059 Kanade's trio 字典树
- Windows配置node环境以及express模块
- java7 [try-with-resources]
- mycat
- LeetCode 35 Search Insert Position
- 串结构练习——字符串连接
- Unix编程学习笔记----对系统调用的完全理解
- 经历过的都是收获
- 【pytorch源码赏析】nn.XX VS nn.functional.XX
- 华为软件开发云对比Jenkins-JavaWeb项目持续部署方式
- 分布式协调服务Zookeeper
- PHP文件上传问题
- python通过正则表达式提取文本
- AnyChat实例