码迷,mamicode.com
首页 >  
搜索关键字:循环 if for while case    ( 74454个结果
最新情报:所有的递归都可以改写成非递归?
前言 本文收录于专辑:http://dwz.win/HjK,点击解锁更多数据结构与算法的知识。 你好,我是彤哥,一个每天爬二十六层楼还不忘读源码的硬核男人。 上一节,我们使用位图介绍了12306抢票算法的实现,没有收到推送的同学可以点击上方专辑查看,或者在公主号历史消息中查看。 在上一节的最后,彤哥 ...
分类:其他好文   时间:2020-08-13 12:26:30    阅读次数:49
PHP FFI调用go,居然比go还快
上一篇文章中用PHP的FFI成功了调用了cjieba,但是速度实在是慢,4个函数循环调用20次,用了居然1分50多秒,而且C版本只比PHP快一点点,看来是cjieba本身慢了。 这次发现了一个golang的分词库gse,试试导出为动态库,用FFI加载。 碰到的问题 不能导出go指针 由于之前对cgo ...
分类:Web程序   时间:2020-08-13 12:13:52    阅读次数:127
计蒜客 T1725 国王的魔镜
首先取出这个项链的长度x,如果他是回文数的话让项链减去一半,x减去一半,如果他不是回文数,就退出循环 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#inc ...
分类:其他好文   时间:2020-08-13 12:13:39    阅读次数:53
mysql if 和 case
if 表达式 CASE WHEN 表达式 ...
分类:数据库   时间:2020-08-13 11:47:44    阅读次数:75
Leetcode202 快乐数 佛洛依德循环
JAVA: public final boolean isHappy(int n) { int next = next(n); while (n != 1 && n != next) { n = next(n); next = next(next(next)); } return n == 1; } ...
分类:其他好文   时间:2020-08-12 15:41:43    阅读次数:51
shell脚本
For循环九九乘法表#!/bin/bashforiin{1..9}doforjinseq$idoecho-e"${j}x${i}=$[i*j]\t\c"doneechodone求奇数和:#!/bin/bashsum=0foriinseq12100求偶数和:seq22100doletsum+=ileti++doneecho$sum批量该文件名后缀#!/bin/bashforiin
分类:系统相关   时间:2020-08-12 15:34:57    阅读次数:68
2020/8/11
变量: 系统变量:全局变量、会话变量 自定义变量:用户变量、局部变量 一、系统变量 说明:变量由系统提供,不是用户定义,属于服务器层面 语法 1、查看所有的系统变量 show global | [session] variables; 2、查看满足条件的部分系统变量 show global |【se ...
分类:其他好文   时间:2020-08-12 14:04:56    阅读次数:74
skynet源码学习(一) linux无锁化编程
以下是skynet源码:structgroupnode{inthandle;structskynetcontextctx;structgroupnodenext;};structgroup{intlock;structgroupnodenode[HASHSIZE];};structgroupG=NULL;inlinestaticvoidlock(structgroupg){while(synclo
分类:Web程序   时间:2020-08-11 17:32:26    阅读次数:90
Leetcode.76 Minimum Window Substring (Java)
Leetcode.76 Minimum Window Substring Given a string S and a string T, find the minimum window in S which will contain all the characters in T in compl ...
分类:编程语言   时间:2020-08-11 15:56:40    阅读次数:64
Mybatis 循环删除/插入
<foreach collection="array" open="(" separator="," close=")" index="index" item="item"> #{item} </foreach> item:集合中元素迭代时的别名,该参数为必选。 index:在list和数组中,in ...
分类:其他好文   时间:2020-08-11 15:54:12    阅读次数:65
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!