码迷,mamicode.com
首页 >  
搜索关键字:int string    ( 220671个结果
消除 if else 判断
1.if..else public int calculate(int a, int b, String operator) { int result = Integer.MIN_VALUE; if ("add".equals(operator)) { result = a + b; } else ...
分类:其他好文   时间:2021-07-15 18:58:38    阅读次数:0
C语言动态分配内存及回收
用malloc和free;类似与C++的new和delete 代码: #include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { void* ptr = (void*)ma ...
分类:编程语言   时间:2021-07-15 18:57:44    阅读次数:0
== 和 equals区别
== equals是两种字符串的方式 区别 == 是比较两个对象的引用地址值 equals是比较两个对象的具体内容 示例 package com.oop.demo06; public class Demo01 { public static void main(String[] args) { St ...
分类:其他好文   时间:2021-07-14 18:50:51    阅读次数:0
为什么 extern 使用 const 修饰的变量会编译不过?
const 变量能被其他文件 extern 引用吗?为什么? 先来看一段代码: // 来源:公众号编程珠玑 // main.cc #include<stdio.h> // 引用外部定义的const_int变量 extern const int const_int; int main() { prin ...
分类:其他好文   时间:2021-07-13 17:45:44    阅读次数:0
C++ JNI jstring to string (utf16 to utf8)
JNI中jstring转码到std::string其实就是utf16转码到你选择的编码的过程,因为我C++程序要用utf8,所以这里我转成utf8 用到的转码库是utfcpp 这个库的使用方法就是下载source文件夹下全部内容,然后#include "utf8.h"在你的项目 代码: std::s ...
分类:编程语言   时间:2021-07-12 18:01:37    阅读次数:0
AcWing 每日一题 - 暑假
本篇解题记录题源来自 AcWing 的每日一题 · 暑假 补题链接:Here Week 1 星期四 AcWing 3761. 唯一最小数 利用 map 存出现过数的下标和次数即可 vector<int>a; int n; int main() { cin.tie(nullptr)->sync_wit ...
分类:Windows程序   时间:2021-07-12 17:54:32    阅读次数:0
drf-路由和认证
一、路由Routers 在 Rest Framework 中提供了两个 router , 可以帮助我们快速的实现路的自动生成。 必须是继承 ModelViewSet 的视图类才能自动生成路由 SimpleRouter 使用方法: urls.py # 第一步:导入routers模块 from rest ...
分类:其他好文   时间:2021-07-12 17:44:56    阅读次数:0
Mysql datetime类型
一般情况下,创建时间、修改时间都是用datetime类型; datetime类型在没有默认值的情况下是不会自动赋值的; 在开发阶段,不想传这两个值,但又想不为null,所以就需要用到CURRENT_TIMESTAMP这个参数。 创建时间: 一般是在创建数据时才会赋值,使用SQL的话,就需要在字段上添 ...
分类:数据库   时间:2021-07-12 17:43:55    阅读次数:0
哈希表减少时间复杂度
哈希表是可以减少时间复杂度的。 因为哈希表物理结构是数组,在没有冲突的情况下,查找时间是O(1),建表时间可能是O(n)。 为什么把普通数组换成hash表就能减少复杂的呢 例如 //数组形式 for(int i=0;i<n;++i) for(int j=0; j<n;++j) printf ( nu ...
分类:其他好文   时间:2021-07-08 17:45:36    阅读次数:0
Http Post Json参数及Json接收
private string HttpRequest(Dictionary<string, object> dic, string url) { string json = JSONhelper.ObjToJson(dic); WebRequest request = WebRequest.Crea ...
分类:Web程序   时间:2021-07-07 17:56:22    阅读次数:0
220671条   上一页 1 ... 3 4 5 6 7 ... 22068 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!