自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 gvim操作备忘

v — 转换为visual模式,可以选择操作内容。G — 转跳到最后一行。此时完成了对全文的全选。J — 合并所选内容为一行。gg — 转跳到首行。

2023-11-08 16:16:17 201

原创 创建工程文件时千万要避免的几个坑

几点提醒,很基础很简单,但是不注意就容易对后续工作造成很大困扰。尤其是在使用那些报错功能一般的软件或者年代久远的软件的时候。+++++++++++++++++++++++++++++++++++++++++++++++++++++++避坑小结:别忘记文件所在位置。在创建时就一定要清楚地记得工程文件所在位置,以方便后续添加其他库。芯片选型一定一定一定要记得,选好对应的型号,每次新建工程都不能忘记。创建项目的文件夹路径里不要有中文!也就是说,不要把文件存在带中文的文件夹下!(因为大部分软件是外国软件

2020-11-17 06:24:06 305

原创 用11行Python代码,实现动态二维码制作

用11行Python代码,实现动态二维码制作效果展示Python实现素材其他工具效果展示Python实现要预装myqr模块才行。windows键+R 打开cmd,输入pip install myqr,回车后就会自动安装。新建一个.py文件,记住文件所在位置。素材和.py文件在同一个文件夹下的话,只要知道素材名字程序就能找到。from MyQR import myqr #使用MyQR模块myqr.run( words='https://baike.baidu.com/item/%E

2020-09-25 03:06:21 509

原创 Python 打印九九乘法表 for和while两种写法

Python 打印九九乘法表# for循环写法for i in range(1,10): for j in range(1,i+1): print( '%d X %d = %d' % (j,i,i*j),end = ' ' ) print(' ')# while循环写法i = 1while i <= 9: j = 1 while j <= i: print('%d X %d = %d' % (j,i,i*j),end

2020-07-26 20:08:01 320

原创 LeetCode 540 Single Element in a Sorted Array 在分类好的数组里寻找单个元素 C语言 异或的巧妙使用

540. Single Element in a Sorted Array原题C语言题解原题You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Find this single element that appears only once.Example

2020-05-14 02:22:26 154

原创 LeetCode 733 Flood Fill 洪水填充 C语言 DFS 深度优先搜索算法

733. Flood Fill题目解题思路代码C语言C++JAVA题目An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fil

2020-05-12 03:20:45 848

原创 LeetCode 997 Find the Town Judge 寻找小镇法官 C语言

Find the Town JudgeIn a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge.If the town judge exists, then:The town judge trusts nobody.Everybody (except for the town judge) trusts the .

2020-05-10 23:16:06 333 1

原创 LeetCode 367 Valid Perfect Square 有效的完全平方 C语言

Valid Perfect SquareGiven a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt.实现函数功能:检测输入的正整数是否能被完全开方,若能被完全开方则函数输出值为true,若不能则输出false。注意,不能使用sqrt.

2020-05-10 03:00:40 217

原创 LeetCode 1232 Check If It Is a Straight Line 检测是否为直线 C语言

Check If It Is a Straight LineYou are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.Example 1:Input: coordinates = [[1,2],[2,3],[3,4].

2020-05-09 01:12:31 337

原创 LeetCode 993 Cousins in Binary Tree 判断二叉树堂兄弟节点 C语言

Cousins in Binary TreeIn a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1.Two nodes of a binary tree are cousins if they have the same depth, but have...

2020-05-08 07:03:56 228

原创 LeetCode 169 Majority Element 多数的元素 C语言

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element alway...

2020-05-06 18:26:29 150

原创 LeetCode 387 First Unique Character in a String 字符串中的第一个唯一的字母 C语言

387. First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1..从给定的字符串中找到第一个不重复的字母,并输出其在字符串中的指针位置(第一个字母的位...

2020-05-06 03:16:18 106

原创 一行代码编辑网页文字(趣味代码)

只要一行代码,即可实时编辑网页文字。打开所要的网页,按F12。然后点击控制台Console,输入如下代码:document.body.contentEditable='true';回车之后即可实时编辑网页文字哈哈哈~(刷新后恢复正常)该方法转自知乎:一行代码可以做什么?----易哥...

2020-05-05 03:24:15 1374

原创 LeetCode 476 Number Complement 补码 C语言

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.输入一个正整数,求其转为二进制之后的每位都取反的值(十进制)。没有符号位。例如:输入的正整数为5,其二进制为101,取反为010,010转...

2020-05-04 19:16:13 128

原创 LeetCode 383 Ransom Note 勒索信 C语言

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; ot...

2020-05-03 22:50:43 175

原创 linux要使用pthread.h库时,文件编译的时候需要在末尾加上 –lpthread。

要使用#include<pthread.h>库,编译的时候需要在末尾加上 –lpthread。例如要将ex2.c编译为ex2执行文件时,需要输入的内容为: gcc ex2.c –o ex2 –lpthread

2020-05-03 04:15:11 940

原创 LeetCode 278 First Bad Version 第一个坏的版本 C语言

First Bad VersionYou are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is de...

2020-05-03 01:18:39 129

原创 LeetCode 771 Jewels and Stones 宝石和石头 C语言

Jewels and StonesYou’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know...

2020-05-03 01:10:31 208

原创 C语言 中“?”和“:”的用法 A?X:Y

在c语言中,符号"?“与”:"是一起出现使用的。两者组合成条件选择语句。例如:N=A?X:Y;该句中"A"为判断条件,“A"为真时N=X,”A”不成立时”N=Y"。例子:n=x>y?1:0; // x>y时n=1,x<=y时n=0;...

2020-05-02 00:35:46 29361 1

原创 LeetCode 1 Two Sum 两数之和 C语言

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same e...

2020-05-01 01:24:42 171

原创 Linux 快速上手makefile基础操作(入门)

快速上手Linux Makefile基础操作(入门)写好Makefile(makefile也可)后,我们就可以在终端控制台中只输入make,就能编译好我们我需要的所有文件。Makefile使用的简单实例:例如现有文件:test.c#include<stdio.h>int main(){ printf("Hello world!\n"); return 0;}我们要...

2020-04-28 04:01:39 342

原创 实现虚拟机里运行的Ubuntu系统和主机Windows双向复制粘贴文本

VirtualBox虚拟机上新装好Ubuntu系统是不能将文本复制粘贴到windows里的。为了能够实现此功能,我们需要安装增强功能并对虚拟机进行简单设置。1.打开virtualbox,进行设置。依次单击:设置-常规-高级-选择共享剪贴板双向。2.打开Ubuntu系统。在Ubuntu菜单栏顶部点击设备,再点击设备菜单下的最后一个选项——安装增强功能。点了之后桌面上会多一个光盘,打开光盘,...

2020-04-25 05:06:08 2425

原创 Linux Ubuntu系统 如何写以Helloworld为例的第一个C语言程序

在Ubuntu里写的第一个C语言程序,Hello world,用简单例子来熟悉ubuntu系统下的C语言编译流程。1.先安装gcc,C语言的编译和运行需要使用gcc1.Ctrl+Alt+t 打开终端控制台;2.输入 sudo apt install gcc 然后回车,再输入账户密码,即可安装gcc;2.编写Hello World程序:1.先touch hello.c创建hello.c...

2020-04-22 05:36:45 696

原创 VM VirtualBox运行Ubuntu系统卡顿提速(亲测有效,附图)

VM VirtualBox虚拟机运行Ubuntu系统卡顿的提速方法(亲测有效,收藏备忘)亲测有效,卡顿明显减少。欣喜之余,记录备忘。原文教程见下方链接。原文没有图,我把自己操作时的截图放在下面。原文:VirtualBox虚拟机运行Ubuntu如何不卡记得要把Ubuntu系统关闭。关闭之后才能在VirtualBox上进行硬件加速、显存等设置。根据原文,我按实际的操作顺序进行了重新排序,并截图...

2020-04-13 22:03:31 17863 2

空空如也

空空如也

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

TA关注的人

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