字符串A中删除字符串B中所有相同字母(无论大小写)
/**
* @func: 字符串A中删除字符串B中所有相同字母(无论大小写)
* @date 2024/05/06
* @version 1.0 :版本
* CopyRight (c) 2023-2024 ni456xinmie@163.com All Right Reseverd
*/
void repeat(char *a, const char *b)
{
char *tmp = a; // 用来写入新字符串的指针
char *temp_b = b; // 用来遍历b字符串的临时变量
while (*a)
{
int found = 0; // 标记是否找到了匹配的字符,如果找到,赋值为1,并退出循环;如果没找到则进行赋值操作
for (temp_b = b; *temp_b; temp_b++)
{
if (*temp_b == *a ||
((*temp_b >= 'A' && *temp_b = 'a' && *a = 'a' && *temp_b = 'A' && *a
统计二维数组 int w【N】【N】周边元素值的平均值,但要注意的是不要重复计算四个角上的元素值。
/**
* @func:计算二维数组的周边元素平均值
* @date 2024/05/06
* @version 1.0
* CopyRight (c) 2023-2024 ni456xinmie@163.com All Right Reseverd
*/
#define N 3
int main()
{
int w[N][N] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int i = 0;
int sum = 0;
for (i = 0; i
计数排序法:
/**
* @func:计数排序一个数组
* @date 2024/05/06
* @version 1.0
* CopyRight (c) 2023-2024 ni456xinmie@163.com All Right Reseverd
*/
void CountSort(int A[], int B[], int bufsize)
{
int count = 0; // 记录个数
for (int n = 0; n
机房租用,北京机房托管,大带宽租用,IDC机房服务器主机租用托管-价格及服务咨询 www.e1idc.net