码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
使用Arrays.copyOf()数组合并并排序
int[] a=new int[3]; int[] b=new int[3]; int[] c = new int[a.length+b.length]; c = Arrays.copyOf(a, c.length); /*arg0 - 源数组。 ...
分类:编程语言   时间:2015-04-12 14:41:11    阅读次数:154
杭电2055 ,注意scanf的细节用法,
#include#includeint main(){ char str; int a,b,n; while(scanf("%d",&n)!=EOF) { for(a=0;a='a'&&str='A'&&str<='Z') ...
分类:其他好文   时间:2015-04-12 14:36:10    阅读次数:100
第六周上机实践项目2——我的数组类
问题及代码 下面的程序,因为存在指针类型的数据成员,需要能完成深复制的构造函数。请补充完整构造函数和析构函数(其他不必动)。其中,构造函数要完成下面三个任务: (1)为各成员函数赋值,按照深复制原则,其中arrayAddr应该是为保存数据新分配的连续空间的首地址; (2)MyArray(int *a, int n)中,要将a指向的数组中的数值,逐个地复制到新分配的arrayAddr指向的空间...
分类:编程语言   时间:2015-04-12 13:28:15    阅读次数:197
【剑指offer】 第三题 二维数组查找
package javaTrain; public class offer3 { public static void main(String args[]) { int[][] a = {{0,1,2,3},{1,2,3,4},{2,3,4,5},{6,7,8,9}}; System.out.println(find(a,10)); } public static boole...
分类:编程语言   时间:2015-04-12 13:27:38    阅读次数:134
HDU 4539
简单状压DP,忘 了初始化,忘 了&和==的优先级,坑了我十几个WA。#include #include #include #include using namespace std;int dp[110][222][222];int row[110];int status[1>=1; } retur...
分类:其他好文   时间:2015-04-12 13:12:15    阅读次数:134
纸牌游戏----蓝桥杯(暴力方法)
蓝桥杯的纸牌游戏,这里我只用了简单的暴力,很费事,其实可以用递归, DP等等来写。 代码: #include #include using namespace std; int main() {     int a[13];         static int count;     int ans = 0;     for(a[0]=0; a[0]     { ...
分类:其他好文   时间:2015-04-12 12:08:34    阅读次数:130
Java方法重载与重写(静态分派与动态分派)
?? Java面向对象3个基本特征:继承、封装和多态;多态主要体现在重载和重写; 1、静态分派 静态分派与重载有关,虚拟机在重载时是通过参数的静态类型,而不是运行时的实际类型作为判定依据的;静态类型在编译期是可知的; 1)基本类型 以char为例,按照char>int>long>double>float>double>Character>Serializable>Object>...(变...
分类:编程语言   时间:2015-04-12 12:08:13    阅读次数:1259
LeetCode Rising Temperature
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. +---------+------------+------------------+ | Id(INT) | Date(DA...
分类:其他好文   时间:2015-04-12 12:05:42    阅读次数:123
C++排序(合并排序)
//合并排序 #include #include using namespace std; void sort(int c[],int a[],int b[],int n) { int i=0; int j=0;//a int k=0;//b while(k!=5 && j!=5) { if(a[j]>b[k]) { c[i++]=b[k++]; } ...
分类:编程语言   时间:2015-04-12 12:04:02    阅读次数:145
C++反汇编学习笔记(五)各种算数运算的工作形式(3)
1、 自增、自减 很简单,没什么可解释的,注意一下前缀和后缀运算的区别C++源码Debug版Release版#include using namespace std;int main(){ int a, b; cin >> a >> b; //自增 a = ++b + 10; cout using....
分类:编程语言   时间:2015-04-12 12:02:51    阅读次数:197
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!