原创 FatMouse' Trade ZOJ:2109

FatMouse' Trade Time Limit: 2 Seconds      Memory Limit: 65536 KB FatMouse prepared M pounds of cat food, ready to trad

原创 GO學習第三天(切片)

指針 func swap(a, b *int) { *a, *b = *b, *a } 函數只有值傳遞,沒有引用 交換值 func main() { a, b := 3, 4 a, b = swap(a, b) fmt.

原创 LeetCode - 3無重複字符的最長子串

題目 給定一個字符串,請你找出其中不含有重複字符的 最長子串 的長度。 示例 1: 輸入: “abcabcbb” 輸出: 3 解釋: 因爲無重複字符的最長子串是 “abc”,所以其長度爲 3。 示例 2: 輸入: “bbbbb”

原创 GO學習第二天(數組)

數字轉字符串 strconv.Itoa(n%2) 一行行讀文件 func printFile () { file, err := os.Open("./learn/abc.txt") if err!=nil { pan

原创 Gene Assembly ZOJ:1076

Gene Assembly Time Limit: 2 Seconds      Memory Limit: 65536 KB Statement of the Problem With the large amount of genom

原创 GO學習第八天(函數閉包)

函數實現接口 package main import ( "bufio" "fmt" "io" "strings" ) func fibonacci() intGen { a, b := 0, 1 return f

原创 C++實現閉包|斐波那契數列

實現斐波那契數列 #include<bits/stdc++.h> using namespace std; auto adder() { auto a = 0, b = 1; return [=]() mutable {

原创 GO學習第六天(面對對象、包)

包 爲結構定義的方法必須放在包內 可以是不同文件 組合 type myNode struct { node *tree.Node } func (node *myNode) after() { if node == ni

原创 GO學習第九天(defer)

defer 確保在函數結束時發生 參數在defer語句計算 defer先進後出 func writeFib(fileName string) { file, err := os.Create(fileName) if er

原创 GO學習第四天(切片操作、map、rune)

切片的append操作 arr := [...]int{0, 1, 2, 3, 4, 5, 6} s1 := arr[2:5] s3 := append(s1, 10) s4 := append(s3, 20) // 超

原创 LeetCode -1兩數之和

題目 給定一個整數數組 nums 和一個目標值 target,請你在該數組中找出和爲目標值的那 兩個 整數,並返回他們的數組下標。 你可以假設每種輸入只會對應一個答案。但是,你不能重複利用這個數組中同樣的元素。 示例: 給定 nu

原创 VS fopen不安全解決

右鍵項目名稱,屬性 預處理器   輸入  _CRT_SECURE_NO_WARNINGS 解決

原创 Vue學習開發總結

總結在近段時間使用Vue開發時遇到的問題及知識點。 Vue.config.silent 日誌警告,在開發環境默認爲true,生成生產環境默認爲false v-pre 可以跳躍編譯,加快編譯速度 v-cloak 用來保持在元素上直到關聯實例

原创 js扁平化數組

 使用apply,可以將任意維度數組降爲一維數組。 [].concat.apply([],arr) 使用es6擴展運算符...,但是隻能降階一層。 [].concat(...arr)  

原创 vs2019配置OpenGL

下載地址: https://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip 1.安裝c++開發組件和NuGet包管理器 這個可以打開Visual Studio Ins