本题要求编写函数,判断给定的一串字符是否为“回文”。所谓“回文”是指顺读和倒读都一样的字符串。如“XYZYX”和“xyzzyx”都是回文。 函数接口定义: bool palindrome( char *s ); 函数palindrome判断输入字符串char *s是否为回文。若是则返回true,否则 ...
分类:
其他好文 时间:
2020-07-05 17:13:19
阅读次数:
61
不多bb 直接代码 #include<iostream> #include<cstdio> using namespace std; const long long k=5e5+5; long long a[k]; struct Segment{ long long l,r; long long s ...
分类:
其他好文 时间:
2020-07-05 17:00:43
阅读次数:
58
准备条件: ①枚举类型: 1 public enum enumColor 2 { 3 Red = 1, 4 Yellow, 5 Green, 6 Blue, 7 White, 8 Black 9 } ②以下状态都是理想状态,并未对错误数据进行处理。 1.枚举类型转换为字符串 private stri ...
单线程同步 使用socket传输数据 使用json序列化消息体 struct将消息编码为二进制字节串,进行网络传输 消息协议 1 // 输入 2 { 3 in: "ping", 4 params: "ireader 0" 5 } 6 7 // 输出 8 { 9 out: "pong", 10 res ...
分类:
编程语言 时间:
2020-07-05 10:54:57
阅读次数:
86
actor person, an organization, or person acting on behalf of an organization NOTE A specialization of the general term object. attribute unit of infor ...
分类:
其他好文 时间:
2020-07-05 10:32:32
阅读次数:
126
golang中json和struct的使用1、返回json响应结果在struct的字段后面加入json:"key"可以进行json格式输出,其中key为json的键名 type SuccessResponse struct { Code int `json:"code"` Msg string `j ...
分类:
Web程序 时间:
2020-07-05 01:04:04
阅读次数:
109
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define ls (l[cnt]) #define rs (r[cnt]) const int N = 100005; struct Ftree { int l[ ...
分类:
其他好文 时间:
2020-07-04 21:12:28
阅读次数:
69
static struct fib_table *fib_empty_table(struct net *net){ u32 id; for (id = 1; id <= RT_TABLE_MAX; id++) if (fib_get_table(net, id) == NULL) return f ...
分类:
系统相关 时间:
2020-07-04 20:30:01
阅读次数:
72
1. No Nine Q: 求 [L, R] 的合法数字个数,合法数字是不能包含9也不能被9整除。L和R一定合法。 A: 自己的想法:区间内多少含有9的数字,多少9的倍数,多少又包含9又是9的倍数,分别计算出来。区间内如果不好求,就写一个函数,是[1,x]内的数字个数,然后[1,R]-[1,L] 官 ...
分类:
其他好文 时间:
2020-07-04 18:48:28
阅读次数:
57
原题链接 题解 一个三维的bfs,直接向6个方向走就是了,直接套模板 #include <iostream> #include <algorithm> #include <queue> using namespace std; typedef struct node{ int x, y, z; no ...
分类:
其他好文 时间:
2020-07-04 15:21:05
阅读次数:
99