1.线形表a、b为两个有序升序的数组(线 性表),编写合并成一个升序数组(线性表)
/*===============================================
* 文件名称:1.c
* 创 建 者:月亮与六便士
* 创建日期:2022年08月25日
* 描 述:
================================================*/
#include <strings.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int * sort_arr(int *a,int *b, const int len1, cosnt int len2)
{
static int dest[]={0};
int i=0,j=0,k=0;
while(i < len1 && j<len2 )
{
if(a[i] < b[j])
{
dest[k++] = a[i++];
}
else
{
dest[k++] = b[j++];
}
}
while(i<len1)
{
dest[k++]=a[i++];
}
while(j<len2)
{
dest[k++] = b[j++];
}
return dest;
}
int main(int argc, char *argv[])
{
int a[]={2,4,6,8,10};
int b[]={3,5,9,11,13};
int *s=sort_arr(a,b,5,5);
for(int i=0;i<10;i++)
printf("%d ",s[i]);
puts("");
return 0;
}
2.用C语言设计一个函数,实现删除字符串中指定的字符。
指针指向字串常量传参不能修改;
指针需要开辟空间在函数体内作为返回值是,需要一片空间保存值;
/*==========&#