码迷,mamicode.com
首页 >  
搜索关键字:str    ( 67828个结果
string实现
class my_string{ friend ostream& operator<< (ostream&,my_string&);public: my_string():data(NULL) { } my_string(const char* str) { int n = strlen(s...
分类:其他好文   时间:2015-01-03 17:07:13    阅读次数:178
hdu 1021 斐波那契2,找规律
背景:暴力必定超数据结构范围,因为斐波那契类型数列,成指数形式爆炸增长。故写了数据发现取余30不影响结果。 学习:1.数论类题可以写出几组数据找规律,猜结论。 我的代码:#include int str[1000009] = { 7, 11 }; int main() { int n; for (int i = 2; i <=1000000; i++){ str[i] = (str[i...
分类:其他好文   时间:2015-01-03 13:17:49    阅读次数:166
OJ刷题之《字符逆序》
Description 将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符。 Input 输入包括一行。第一行输入的字符串。 Output 输出转换好的逆序字符串。 Sample Input I am a student SampleOutput tneduts a ma I 代码如下: #include #include usi...
分类:其他好文   时间:2015-01-03 09:24:42    阅读次数:195
CUDA数组分配
原问链接概述:数组分配可以通过cudaMallocArray()和cudaMalloc3DArray()1、cudaMallocArray()cudaError_t cudaMallocArray ( struct cudaArray ** array, const str...
分类:编程语言   时间:2015-01-02 22:18:15    阅读次数:360
java中判断一个字符串是否“都为数字”和“是否包含数字”和“截取数字”
在javascript中有一个方法isDigit()使用来判断一个字符串是否都是数字,在java的字符串处理方法中没有这样的方法,觉得常常需要用到,于是上网搜了一下,整理出了两个用正则表达式匹配的判断方法,如下:// 判断一个字符串是否都为数字 public boolean isDigit(Str....
分类:编程语言   时间:2015-01-02 22:14:25    阅读次数:158
[LeetCode]8 String to Integer (atoi)
https://oj.leetcode.com/problems/string-to-integer-atoi/http://fisherlei.blogspot.com/2013/01/leetcode-string-to-integer-atoi.htmlpublicclassSolution{ publicintatoi(Stringstr){ //Validations if(str==null||str.length()==0) return0; char[]chars=str.trim()...
分类:其他好文   时间:2015-01-02 16:14:54    阅读次数:157
字符串处理
#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;#define N 2011111char str[1111];int s...
分类:其他好文   时间:2015-01-02 08:37:51    阅读次数:111
Mysql主从检测脚本
#!/usr/bin/envpython#KissPython#*/10****/usr/bin/python/root/checkslave.pyimportMySQLdbimporttimeimportparamikoips=[‘127.0.0.1‘]mailcontact=‘yiqiang.wei@kisspython.com‘mobilecontact=‘18701669895‘checklog=open(‘slave.log‘,‘a‘)checklog.write(str(time.strftime..
分类:数据库   时间:2015-01-02 07:36:11    阅读次数:244
Python下实现文件中的全文搜索小测试
username=‘test‘ password=‘123456‘ whileTrue: user_str=raw_input("Pleaseinputyourname>>") pass_str=raw_input("Pleaseinputyourpassword>>") ifusername!=user_strorpassword!=pass_str: print"Sorry,Youinputwrongusernameorpassword!" continue el..
分类:编程语言   时间:2015-01-02 07:32:32    阅读次数:247
MySQL 常用命令[不断更新中]
1.查看表结构DESC TableName;2.查看表创建语句SHOW CREATE TABLE TableName3.连接字符串CONCAT(r.USER_ID,”:")4.截取字符串RIGHT(r.CARD_ID,6)LEFT(r.CARD_ID,6)substring(str, pos, le...
分类:数据库   时间:2015-01-02 06:20:46    阅读次数:190
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!