字符串连接
来源:互联网 发布:张无忌武功排名知乎 编辑:程序博客网 时间:2024/05/18 19:38
#include<stdio.h>
#include<string.h>
int main()
{
char s[200],t[100],r[199];
int i=0,m,k,j;
gets(t);
gets(s);
scanf("%d",&m);
i=0;
while(i<m)
{
r[i]=s[i];
i++;
}
k=i;
j=i;
i=0;
while(t[i]!='\0')
{
r[j]=t[i];
i++;
j++;
}
while(s[k]!='\0')
{
r[j++]=s[k++];
}
r[j]='\0';
printf("%s",r);
}
#include<string.h>
int main()
{
char s[200],t[100],r[199];
int i=0,m,k,j;
gets(t);
gets(s);
scanf("%d",&m);
i=0;
while(i<m)
{
r[i]=s[i];
i++;
}
k=i;
j=i;
i=0;
while(t[i]!='\0')
{
r[j]=t[i];
i++;
j++;
}
while(s[k]!='\0')
{
r[j++]=s[k++];
}
r[j]='\0';
printf("%s",r);
}
0 0
- 连接字符串
- 字符串连接
- 连接字符串
- 连接字符串
- 连接字符串
- 连接字符串
- 连接字符串
- 连接字符串
- 连接字符串
- 字符串连接
- 连接字符串
- 字符串连接
- 字符串连接
- 连接字符串
- 字符串连接
- 字符串连接
- 连接字符串
- 字符串连接
- android机型适配终极篇
- LeetCode 52. N-Queens II
- 编辑移除
- x265-1.7版本-common/lowres.cpp注释
- 从plist读取数据并封装
- 字符串连接
- ximalaya
- 集合collection 2016 1 22
- android常见的颜色代码
- leetcode222---Count Complete Tree Nodes(求完全二叉树节点数)
- Mac上的matlab出现mex error解决
- sequelize常见操作使用方法(增删改查,手把手教学)
- 利用block从前后一个页面到前一个页面传值
- 自定义类加载器