Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by ...
分类:
其他好文 时间:
2020-10-18 10:19:49
阅读次数:
29
二 字符串类型(string) 字符串是以单引号'或双引号"括起来的任意文本,比如'abc',"123"等等。 请注意,''或""本身只是一种表示方式,不是字符串的一部分,因此,字符串'abc'只有a,b,c这3个字符。如果'本身也是一个字符,那就可以用""括起来,比如"I'm OK"包含的字符是I ...
分类:
其他好文 时间:
2020-10-18 10:17:55
阅读次数:
32
Description Xiaoqiang wrote a decimal number \(X\), but some of the handwriting has been blurred (we replaced it with ?). Now given another decimal nu ...
分类:
其他好文 时间:
2020-10-18 10:17:30
阅读次数:
29
1 #pragma once 2 #include <initializer_list> 3 struct String { 4 String(const char*s) { 5 c_str = new char[strlen(s)+1]; 6 while (*s) { 7 *(c_str+sz) ...
分类:
其他好文 时间:
2020-10-18 10:09:18
阅读次数:
18
#include<bits/stdc++.h>包含了目前c++所包含的所有头文件 对比: #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include < ...
分类:
编程语言 时间:
2020-10-18 09:59:50
阅读次数:
17
第一个发送 public class May { public static void main(String[] args) {// 单线程程序 try { ServerSocket socket = new ServerSocket(2233);//端口号 Socket soc = socket ...
分类:
编程语言 时间:
2020-10-18 09:55:39
阅读次数:
31
后台服务 public class Server { public static void main(String[] args) throws IOException { ServerSocket s = new ServerSocket(1122);//服务器端口号 Socket ss = s. ...
分类:
编程语言 时间:
2020-10-18 09:52:35
阅读次数:
26
关键源码 1 public ConfigurableApplicationContext run(String... args) { 2 StopWatch stopWatch = new StopWatch(); 3 stopWatch.start(); 4 ConfigurableApplica ...
分类:
编程语言 时间:
2020-10-18 09:44:37
阅读次数:
23
首先我们来了解一下String类,Java的字符串是一旦被赋值之后无法更改的(这里的无法更改是指不能将字符串中单个或一段字符重新赋值),这也是Java虚拟机为了减少内存开销,避免字符串的重复创建设立的机制,也就是字符串池。 那么字符串池是干嘛的呢?先不急,我们先来回顾一下两种创建字符串的方式。 (1 ...
分类:
编程语言 时间:
2020-10-18 09:43:32
阅读次数:
19
java处理时间的基础类 jdk8 中对时间处理的api有 LocalDate、LocalDateTime,LocalTime等,相对之前的Date更加好用。 格式化时间的有DateTimeFormatter,且是线程安全的。 System.out.println("日期: "+LocalDate. ...
分类:
编程语言 时间:
2020-10-18 09:27:58
阅读次数:
22