码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
Mybatis 中在传参时,${} 和#{} 的区别
介绍 MyBatis中使用parameterType向SQL语句传参,parameterType后的类型可以是基本类型int,String,HashMap和java自定义类型。 在SQL中引用这些参数的时候,可以使用两种方式#{parameterName}或者${parameterName}。 #{ ...
分类:其他好文   时间:2016-09-13 22:02:41    阅读次数:137
求解整数中含有几个1
public class Solution { public int NumberOf1(int n) { int count = 0; while(n!= 0){ count++; n = n & (n - 1); } return count; } } 这段小小的代码,很是巧妙。 如果一个整数不 ...
分类:其他好文   时间:2016-09-13 22:01:38    阅读次数:117
1001. 害死人不偿命的(3n+1)猜想
#include <iostream>using namespace std;int main(){ int n; int i = 0; cin >> n; if (n == 1) { cout << "0" << endl; exit(0); } else { B:if (n % 2 == 0) ...
分类:其他好文   时间:2016-09-13 20:48:02    阅读次数:116
JAVA将秒的总和转换成时分秒的格式
public static void main(String[] args) { String str = "221"; int seconds = Integer.parseInt(str); int temp=0; StringBuffer sb=new StringBuffer(); temp ...
分类:编程语言   时间:2016-09-13 20:47:20    阅读次数:426
程序填空
这里填啥?? return new char-""; 能想出来的也是神人了。。。。。。。。。。。。。。。。。。。。膜拜 new int new char 都不行 new int返回的是地址 new char 返回的是 char 字符会乱码 ...
分类:其他好文   时间:2016-09-13 20:46:58    阅读次数:168
mysql查询今天,昨天,近7天,近30天,本月,上一月数据的方法(摘录)
mysql查询今天,昨天,近7天,近30天,本月,上一月数据的方法分析总结: 话说有一文章表article,存储文章的添加文章的时间是add_time字段,该字段为int(5)类型的,现需要查询今天添加的文章总数并且按照时间从大到小排序,则查询语句如下: 或者: 假设以上表的add_time字段的存 ...
分类:数据库   时间:2016-09-13 19:07:53    阅读次数:189
冒泡排序
package 课上练习; import java.util.Arrays; public class Maopao { public static void main(String[] args) { int[] a={23,42,12,8,5,10}; System.out.println("原 ...
分类:编程语言   时间:2016-09-13 18:58:47    阅读次数:154
基数排序 - 次位优先算法
算法描述 多关键字排序: 又比如123,主位是1,次卫是3。 123,46,791。 按照次位优先 次位:791,123,46 次次位:123,46,791 次次次位:46,123,791 具体实现 建立桶元素结点,用链表实现。 建立桶头尾结点结构体。 构造GetDigit ( int X, int ...
分类:编程语言   时间:2016-09-13 13:42:19    阅读次数:599
一些数组排序算法的简单实现(冒泡、插入、希尔、归并和qsort)
#include <stdlib.h> #include <string.h> #include "sort.h" //冒泡排序 int bubbleSort(int a[], int n) { int i, j; for (i=n-1; i>=0; i--) { for (j=0; j<i; j+ ...
分类:编程语言   时间:2016-09-13 13:36:08    阅读次数:206
发一个存储过程,个人比较常用的语法都在里头了
CREATE PROCEDURE `proc_updatehouse`()BEGIN #Routine body goes here... declare eof int ; declare projname varchar(200) charset utf8 default '' ; declar ...
分类:其他好文   时间:2016-09-13 13:22:59    阅读次数:107
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!