码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Nginx 设置禁用 OPTIONS 请求
Nginx 设置禁用 OPTIONS 请求 1、修改 nginx 配置 在 nginx.conf 配置文件中,增加如下内容: if ($request_method ~* OPTIONS) { return 403; } 效果如下: 2、重启 nginx 服务 ...
分类:其他好文   时间:2021-01-14 11:24:43    阅读次数:0
LeetCode938. 二叉搜索树的范围和
题目 1 class Solution { 2 public: 3 int sum = 0; 4 int rangeSumBST(TreeNode* root, int low, int high) { 5 dfs(root,low,high); 6 return sum; 7 } 8 void d ...
分类:其他好文   时间:2021-01-14 11:04:51    阅读次数:0
JavaScript function 常用的几种写法
JavaScript function 常用的几种写法 函数可以通过声明定义,也可以是一个表达式。 函数声明: function functionName(parameters) { 执行的代码 } 函数表达式: var x = function (a, b) {return a * b}; 写法1 ...
分类:编程语言   时间:2021-01-14 10:59:46    阅读次数:0
剑指 Offer 28. 对称的二叉树
13分钟内递归一次性解出 思路如下: class Solution { public boolean isSymmetric(TreeNode root) { //注意可能为null if(root==null) {return true;} return mirrorTree(root.left, ...
分类:其他好文   时间:2021-01-14 10:53:52    阅读次数:0
sstream 的用法 : (stringstream) 和 sscanf()的用法
题目: 单词替换 输入一个字符串,以回车结束(字符串长度不超过100)。 该字符串由若干个单词组成,单词之间用一个空格隔开,所有单词区分大小写。 现需要将其中的某个单词替换成另一个单词,并输出替换之后的字符串。 输入格式 输入共3行。 第1行是包含多个单词的字符串 s; 第2行是待替换的单词a(长度 ...
分类:其他好文   时间:2021-01-13 11:11:45    阅读次数:0
[Leetcode]1. Two Sum
题目描述 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that eac ...
分类:其他好文   时间:2021-01-13 11:07:09    阅读次数:0
统计二进制序列中1的个数
问题:给定一个无符号整型的对象,统计其二进制序列中1的个数? 遍历: unsigned bit_count(unsigned x) { unsigned result=0; while(x){ result+=x&01?1:0; x>>=1; } return result; } 位运算: unsi ...
分类:其他好文   时间:2021-01-13 11:05:06    阅读次数:0
JS方法
JS方法 var xiaoming = { name: '小明', birth: 1990, age: function () { var y = new Date().getFullYear(); return y - this.birth; }};?xiaoming.age; // functi ...
分类:Web程序   时间:2021-01-13 11:01:06    阅读次数:0
JS函数
JS函数 函数定义 function abs(x) { if (x >= 0) { return x; } else { return -x; }} abs()函数实际上是一个函数对象,而函数名abs可以视为指向该函数的变量。 var abs = function (x) { if (x >= 0) ...
分类:Web程序   时间:2021-01-13 10:59:59    阅读次数:0
LeetCode637. 二叉树的层平均值
题目 1 class Solution { 2 public: 3 vector<double>ans; 4 vector<double> averageOfLevels(TreeNode* root) { 5 if(!root) return ans; 6 queue<TreeNode*>q; 7 ...
分类:其他好文   时间:2021-01-13 10:58:14    阅读次数:0
60766条   上一页 1 ... 82 83 84 85 86 ... 6077 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!