码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Python查找字符串s1中含有s2子串的个数
思路:从s1的第0位开始切片len(s2)个字符串进行比较,相同则计数加1,依次后移,直到最后. def search_substr(s1, s2): if len(s2) > len(s1): return 0 cnt = 0 for i in range(len(s1)): print(i) t ...
分类:编程语言   时间:2021-04-09 13:07:30    阅读次数:0
python orm 多表查询
test_or.py from sqlalchemy import Table, Column, Integer,String,DATE, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.ext.declarati ...
分类:编程语言   时间:2021-04-09 12:56:13    阅读次数:0
C++ break,continue,return用法
一.break 1. break语句形式: break;2. break语句功能:A. 在switch语句中,break是其语法本省的一部分,break语句会终止其后语句的执行,退出switch语句。B. 使一个循环立即结束,也就是说在循环中遇到break语句时,循环立即终止,程序转到当前循环体后的 ...
分类:编程语言   时间:2021-04-08 13:57:16    阅读次数:0
977. Squares of a Sorted Array
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I ...
分类:其他好文   时间:2021-04-08 13:55:44    阅读次数:0
快速幂取模
long long myPow(long long x, int n) { long long ans = 1; while(n){ if(n % 2 != 0){ ans *= x; ans %= modN; } x *= x; x %= modN; n /= 2; } return ans; } ...
分类:其他好文   时间:2021-04-08 13:55:01    阅读次数:0
std::move的理解
std::move 的定义 template <typename T> // typename表明type是一个类型 typename remove_reference<T>::type&& move(T&& t) { return static_cast<typename remove_refer ...
分类:其他好文   时间:2021-04-08 13:54:15    阅读次数:0
Python函数的用法
#函数 def hello(): #定义函数 print("python 你好!") hello() #调用函数 def add(a,b): #定义函数 return a+b #返回值 add(1,2) add #直接用函数名,可返回函数变量名的内存地址 x = add #将函数名赋值给变量 x(1 ...
分类:编程语言   时间:2021-04-08 13:50:11    阅读次数:0
“浪潮杯”第九届山东省ACM大学生程序设计竞赛 F: Four-tuples容斥定理
题目 F : Four-tuples 输入 1 1 1 2 2 3 3 4 4 输出 1 题意 给l1, r1, l2, r2, l3, r3, l4, r4? , 八个数据, 要求输出在区间[l1, r1] , [l2, r2] , [l3, r3] , [l4, r4?] (记为A, B, C, ...
分类:其他好文   时间:2021-04-08 13:43:44    阅读次数:0
结构体内重载
注意是 d < x.d struct Node { int d, e; bool operator < (const Node x) const { return d < x.d; //从小到大排序 } }; ...
分类:其他好文   时间:2021-04-08 13:16:49    阅读次数:0
题目:9. 回文数
方式一(将整数转换为字符串,在转换为字符数组): public boolean isPalindrome(int x) { if (x < 0) { return false; } char[] chars = new String(Integer.toString(x)).toCharArray( ...
分类:其他好文   时间:2021-04-08 13:10:24    阅读次数:0
60766条   上一页 1 ... 45 46 47 48 49 ... 6077 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!