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
#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
问题及代码
下面的程序,因为存在指针类型的数据成员,需要能完成深复制的构造函数。请补充完整构造函数和析构函数(其他不必动)。其中,构造函数要完成下面三个任务:
(1)为各成员函数赋值,按照深复制原则,其中arrayAddr应该是为保存数据新分配的连续空间的首地址;
(2)MyArray(int *a, int n)中,要将a指向的数组中的数值,逐个地复制到新分配的arrayAddr指向的空间...
分类:
编程语言 时间:
2015-04-12 13:28:15
阅读次数:
197
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
简单状压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面向对象3个基本特征:继承、封装和多态;多态主要体现在重载和重写;
1、静态分派
静态分派与重载有关,虚拟机在重载时是通过参数的静态类型,而不是运行时的实际类型作为判定依据的;静态类型在编译期是可知的;
1)基本类型
以char为例,按照char>int>long>double>float>double>Character>Serializable>Object>...(变...
分类:
编程语言 时间:
2015-04-12 12:08:13
阅读次数:
1259
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
//合并排序
#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
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