string int2str(int x) { return x ? num2str(x/10)+string(1,x%10+'0') : "";} int str2int(string s) { int x = 0; for (char it : s) x = x*10+it-'0'; return x;} PS:谁还能更短(>.<)…
云服务器环境:CentOS 7.4 因为服务器配置较低,故使用MySQL5.5 未进行设置前 1.查看字符编码: mysql> show variables like '%character%'; 或 mysql> show variables like 'character_set_%'; 结果: 2.对应修改 2.1可通过命令行设置: set character_set_client = utf8; set character_set_server = utf8; set characte…
1.定义服务接口 public interface RpcService { int printHello(int msg); } 2.定义服务接口实现类 public class RpcInterfaceImpl implements RpcService{ @Override public int printHello(int msg) { return msg; } } 3.定义服务提供者 public class RpcProvider { public static void main…