自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 《C语言入门100例》(第32例) 字符串反转 ——课后习题

反转字符串https://leetcode-cn.com/problems/reverse-string/今天的课后习题非常简单void swap(char *a, char *b){ char temp; temp = *a; *a = *b; *b = temp;}void reverseString(char* s, int sSize){ int i; for(i = 0; i < sSize/2; ++i){ // (1) .

2021-12-03 12:47:12 701

原创 《C语言入门100例》(第31例) 计数

448. 找到所有数组中消失的数字https://leetcode-cn.com/problems/find-all-numbers-disappeared-in-an-array/对着官方题解做出来的int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize){ for(int i = 0; i<numsSize;++i){ int x = (nums[i] - 1) % numsSize

2021-12-02 13:33:23 387

原创 《C语言入门100例》(第30例) 二分查找

二分查找https://leetcode-cn.com/problems/binary-search/

2021-12-01 10:45:50 73

原创 《C语言入门100例》(第29例) 顺序表删除——课后习题

今天只会写一题删除有序数组中的重复项https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/int removeDuplicates(int* nums, int numsSize){ if(numsSize == 0){ return 0; } int i, j;//定义两个指针,i是慢指针,j是快指针。 for(i=0,j = 1;j<numsSize;++j

2021-11-30 14:26:49 650

原创 [万人前提计划]《C语言入门100例》(第27例) 穷举查找——习题(C语言)

统计位数为偶数的数字https://leetcode-cn.com/problems/find-numbers-with-even-number-of-digits/简单遍历一般,将数位计数,偶数加一,最后输出结果。int findNumbers(int* nums, int numsSize){ int count = 0, ans = 0; int i; for(i = 0; i < numsSize; ++i){ int tmp = nums[.

2021-11-28 15:49:55 268

原创 《C语言入门100例》(第25例) 多维枚举 课后习题 作业题解

判断子序列https://leetcode-cn.com/problems/is-subsequence/双指针解法bool isSubsequence(char * s, char * t){ while(*s && *t){ if(*s == *t){ s++; } t++; } if(*s == '\0'){ return true; }else{ return

2021-11-26 12:05:03 523

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除