码迷,mamicode.com
首页 >  
搜索关键字:strlen    ( 2530个结果
javascript数据类型之字符串
字符串常用方法 1 字符串的定义 /* 凡是引号当中的内容都是字符串;?? */ "该号码可注册" "12916316319" "" "http://www.163.com" 'http://www.163.com' 2 字符串的长度 str.length /* str.length */ "mic ...
分类:编程语言   时间:2021-01-19 12:23:02    阅读次数:0
[atARC077F]SS
(以下字符串下标从0开始,并定义$2s=s+s$) 考虑$f(S)$,即令$l=\max_{2i<|S|且S[0,i)=S[|S|-i,|S|)]}i$,则$f(S)=S+S[l,|S|-l)$ 由于次数足够多,先做一次$S=f(S)$不影响答案,因此假设原串为$2S$(这个$S$不同于初始的$S$ ...
分类:其他好文   时间:2021-01-13 11:24:36    阅读次数:0
【leetcode】306. 累加数
bool isAdditiveNumber(char * num){ int i, j, k, len=strlen(num), pst1=0, pst2=0, bit=0, third; char* tmp1=(char*)calloc(22,sizeof(char)); char* tmp2=( ...
分类:其他好文   时间:2021-01-05 11:20:52    阅读次数:0
【leetcode】299. 猜数字游戏
char * getHint(char * secret, char * guess){ int shash[10]={0}; int ghash[1000]={0}; int i, len=strlen(secret), A=0, B=0, l=0; char* s=(char*)calloc(1 ...
分类:其他好文   时间:2021-01-05 10:37:37    阅读次数:0
一个关于字符串的c语言程序
源程序: #include <stdio.h>#include <string.h> int main(){ char str[20]; int length; length=strlen(strcpy(str,"Hello World!")); printf("字符串长度:%d\n",length ...
分类:编程语言   时间:2020-12-19 12:52:11    阅读次数:5
QT绑定Lua脚本,相互调用
0. 前言 最近有个需求,就是需要在QT(C++)中移植lua脚本。达到可以动态更新软件功能。lua是一门脚本语言。常用于各类编程语言,作为脚本。特别是游戏行业,据说很多用lua脚本来写业务逻辑。本次分为两种调用,一种是QT调用Lua,这种比较简单。利用Lua源码编译后,直接就可以使用。另外一种是L ...
分类:其他好文   时间:2020-12-11 11:52:18    阅读次数:4
字符串翻转
function test($str,$con='utf-8'){ $result = ''; $len = strlen($str); for($i=$len-1;$i>=0;$i--){ $result .= mb_substr($str,$i,1,$con); } return $result ...
分类:其他好文   时间:2020-12-09 12:04:18    阅读次数:6
(自用)pta上的gets
忘了从哪里找的了... char s[10001]; fgets(s,10005,stdin);int n = strlen(s);if (s[n - 1] == '\n' && s[n] == '\0'){ s[n - 1] = '\0';}n = strlen(s); ...
分类:其他好文   时间:2020-11-25 12:25:00    阅读次数:6
对图片进行Base64转码和解码
Base64代码 base64.c #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> // bindata待编码数据buffer base64 编码后数据 ...
分类:其他好文   时间:2020-11-24 12:13:36    阅读次数:7
2020.11.6 Rating 补题报告
A - Presents 题意:第i个数是pi给礼物编号i送礼的朋友的编号(啊绕死) 做法:总之就是输出的时候第i个数要输出i的位置,比如 2(1) 3(2) 4(3) 1(4) 4 (1)1(2) 2(3) 3(4) 啊没错就是位置和数字换过来! 代码: //???????£???AC?????? ...
分类:其他好文   时间:2020-11-20 11:45:01    阅读次数:4
2530条   上一页 1 2 3 4 5 ... 253 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!