摘要:
package main import ( "fmt" "net/http" "strings" ) func main(){ reader := strings.NewReader("hello") req, _ := http.NewRequest(http.MethodGet,"http:// 阅读全文
摘要:
点击查看代码 package main import ( "fmt" "math/rand" "time" ) /* 冒泡排序 */ func bubbleSortInts(a []int, sortOrder func(int,int) bool) { length := len(a) for t 阅读全文
摘要:
多个fmt.Scanf()输入方式: Please Input Str: Please Input Substr: str=asdfsadfadsafdfddsfsad,substr=d 输出:2 21 点击查看代码 package main import ( "fmt" "strings" ) f 阅读全文
摘要:
1,判断开头strings.HasPrefix(url, "https://") 点击查看代码 package main import ( "fmt" "strings" ) func urlProcess(url string) string { if !strings.HasPrefix(url 阅读全文
摘要:
输入方式: 111空格222,多个fmt.Scanf()即使不是紧挨着,也要用空格,分隔开的,为啥会这样,还没搞清楚 点击查看代码 package main import ( "fmt" "math/big" ) //输入方式: 111空格222,多个fmt.Scanf()即使不是紧挨着,也要用空格 阅读全文
摘要:
点击查看代码 package main import ( "bufio" "fmt" "os" ) func main() { var str string buff := bufio.NewReader(os.Stdin) str, _ = buff.ReadString('\n') str = 阅读全文
摘要:
package main import "fmt" func isPalindromeStr(str string) bool { stop := len(str) / 2 for i := 0; i <= stop; i++ { if str[i] != str[len(str) - i - 1] 阅读全文