一、N-S流程图;
二、运行结果;
三、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>int main()
{//初始化变量值;char a[80], b[80];int i, n1, n2;//填充字符串;printf("请输入字符串a的内容:");gets(a);//换行;printf("\n");printf("请输入字符串b的内容:");gets(b);//打印两个字符串;printf("字符串a为:%s\n", a);printf("字符串b为:%s\n", b);//赋值;n1 = 0;n2 = 0;//得出两个字符串的长度;while (a[n1] != '\0'){n1++;}while (a[n2] != '\0'){n2++;}//转换;for (i = 0; i < n2; i++){//转换;a[n1 + i] = b[i];}//打印结果;printf("a和b拼接后的字符串为:%s\n", a);return 0;
}