代码实例图:package judgment;/** * 计算下面级数之和 * 1/3+3/5+5/7+...+97/99; */public class Judgment { public static void main(String[] args) { double num=0; for (i ...
分类:
编程语言 时间:
2021-04-26 13:07:27
阅读次数:
0
问题描述: 给你一个字符串 s,找到 s 中最长的回文子串。 代码: public class Solution { public String longestPalindrome(String s) { int len = s.length(); if (len < 2) { return s; ...
分类:
其他好文 时间:
2021-04-24 13:42:33
阅读次数:
0
os.Args是个[]string 里面存着路径和全部参数 直接拼接一下就获取到完整路径了 func GetAllExecutePath()string{ allPath:="" for _,arg:=range os.Args{ allPath+=" "+arg } return allPath ...
分类:
其他好文 时间:
2021-04-24 13:25:34
阅读次数:
0
【Redis,Netty,Nginx 等实现高性能IO的核心原理】 I/O 输入输出(input/output)的对象可以是文件(file), 网络(socket),进程之间的管道(pipe)。在linux系统中,都用文件描述符(fd)来表示。 I/O 多路复用(multiplexing) I/O ...
分类:
Web程序 时间:
2021-04-24 13:10:34
阅读次数:
0
客户端: class SocketClient { private byte[] byteRcvbuf; public Socket Client { get; set; } public string SocketIP { get; set; } public uint SocketPort { ...
分类:
其他好文 时间:
2021-04-24 11:54:07
阅读次数:
0
百度下载QueryList类库文件 /** * 抓取数据源 * @param $rules array 抓取规则 * @param $url string url * @return mixed */ function getQueryList($rules, $url) { $html = fil ...
分类:
Web程序 时间:
2021-04-23 12:26:15
阅读次数:
0
下面我们再给出一个线程不安全的例子。 例:1.8.2 class BookMark_to_win { int bookNum=10; void onlySellOne() { if (bookNum > 0) { System.out.println(Thread.currentThread().g ...
分类:
编程语言 时间:
2021-04-23 12:23:20
阅读次数:
0
学习自:CS-Note Leetcode 题解 - 双指针 1、有序数组的Two Sum 167. 两数之和 II - 输入有序数组 题目描述: 给定一个已按照 升序排列 的整数数组 numbers ,请你从数组中找出两个数满足相加之和等于目标数 target 。 函数应该以长度为 2 的整数数组的 ...
分类:
其他好文 时间:
2021-04-23 12:22:04
阅读次数:
0
考个研真的把很多东西都忘光了,,, #include <string_view> #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; class Sampl ...
分类:
其他好文 时间:
2021-04-23 12:18:50
阅读次数:
0
题目描述 输入输出描述 样例 题目大意 对于一个kmp匹配的问题,Chenjb给出了错误的贪心做法,求在某一特定需要匹配的字符串时,他的贪心代码可不可以通过所有样例。 分析 首先要读懂它的贪心算法是啥意思,之后再把它和kmp算法进行比较,把不同的情况判断一下就行。 它的贪心就是从前往后开始遍历,但是 ...
分类:
其他好文 时间:
2021-04-23 12:11:15
阅读次数:
0