Tag:Null character
-
13. Roman numeral to integer (leetcode) – C language
Idea:Traverse the string and compare the size of the decimal number corresponding to the current Roman character and the next Roman character.If it is greater than, the number will be accumulated to num. if it is less than, their difference will be calculated and accumulated to num.After traversal, return num. The first version does not […]
-
14. Longest common prefix (leetcode) – C language
Method 1: horizontal traversal method //Transverse traversal method #include <stdio.h> #include <string.h> #include <stdlib.h> int getCommonPrefix(char *prev, char *next) { int len = strlen(prev) < strlen(next) ? strlen(prev) : strlen(next); int k = 0; while (k < len) { if (prev[k] != next[k]) { return k; } k++; } return k; } char *longestCommonPrefix(char **strs, […]
-
Oeasy teaches you to play VIM – 14 – # beginning and end of line
Beginning and end of line Recall the last lesson We understand this timeBig wordsandSmall words Small wordsIt’s a word in our regular sense cover=、”Equipunctuation separated words Big wordsIt includes=、”Equal punctuation Can only be separated by spaces, tabs, and line breaks W、E、BCan have big word movement But if I want to jump to the beginning or […]
-
Oeasy teaches you to play VIM – 17 – # up and down
Up and down Recall the last lesson andfRelated is to jump to towardsfrontJump to yesf towardsafterJump to yesF andtRelated is to stick towardsfrontClose yest towardsafterClose yesT anda lowercase letterRelated isforward forwardJump isf forwardClose yest andCapitalizeRelated isbackward backwardJump isF backwardClose yesT And continueFind directionRelated is;、, Keep directionyes; Change directionyes, Up and down This time, it is […]
-
Oeasy teaches you to play VIM – 16 and jump to a certain line
Jump to a line Recall the last lesson Up and down towardsloweryesj👇 towardsupperyesk👆 Uplink and downlink head towardslowerTo non empty character at the beginning of line+ towardsupperTo non empty character at the beginning of line- thesemotionCan be added[count]To double First and last lines The first line isg g The last line isG g g = […]
-
Oeasy teaches you to play VIM – 38 – # cooperate with mobile
Quick delete Recall the last lesson It was previously known that it can be used in the inserted statedel、BackspaceDelete Now we know that by defaultxDelete character Can be inxFront use[count]Double as 10x Deleted characters are stored in””Register Can use:regView register status The default state can be usedXBackspace Deleted characters are also””Register We have mastered various […]
-
Oeasy teaches you to play VIM – 40 – # copy and paste
Copy paste Recall the last lesson What we did last time was paste a lowercase letterpMeans to paste under or behind the cursor CapitalizePMeans to paste above or in front of the cursor pI meanPut it on, yesput What do you put on it? holdregin””Put your content on it IfregCut a whole line or multiple […]
-
News crawler and query website for crawling results
@TOC The complete code can access the GitHub link Experimental requirements 1、 Core requirements 1. Select 3-5 representative news websites (such as Sina News and Netease News, or authoritative websites in a vertical field, such as snowball finance and Oriental Wealth in the economic field, or Tencent sports and Hupu sports in the sports field) […]
-
Introduction to the best string function
Copy the C string to the array pointed to by the target, including the terminated null character (and stop at that point). In order to avoid overflow, the size of the array pointed to by the target should be long enough to contain the same C string as the source (including terminated null characters), and […]
-
Oeasy teaches you to play with VIM – 70 – # folding details
Fold detail Recall last time Last time we talked about folding There are many options for folding foldlevel-Show collapse hierarchy foldcolumn-Collapse tree width foldmethod-Folding mode manual-Manual indent-Indent Definition of folding zf2j The current line and the following two lines create a fold zfa{ Creates a fold with curly braces (inclusive) zfi{ Creates a fold with […]
-
C serial 23 – usage of star in input and output
1、 Return value of scanf() The scanf() function returns the number of items successfully read If no item is read, and a number needs to be read, but a non number is read, 0 will be returned When “end of file” is detected, EOF will be returned (EOF is a special value in the header […]
-
Analysis of markdown it principle
preface stay“A blog with vuepress + GitHub pages”In, we used vuepress to build a blog. The final effect is as follows:Typescript Chinese document。 In the process of building a blog, out of practical needs, weVuepress blog Optimization: extended markdown syntaxExplained how to write onemarkdown-itPlug in, we will go deep into this articlemarkdown-itSource code, explainmarkdown-itThe implementation […]