数学推导题,f(n)=n*(n+1)*(n+2)/6
推导思路如下:
#include"cstdio"
#include"cstring"
#include"cmath"
#include"cstdlib"
#include"iostream"
#include"algorithm"
#include"queue"
using namespace std;
int main()...
分类:
其他好文 时间:
2014-05-23 02:13:15
阅读次数:
269
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
public class TraditionalTimerTest {
static int count;
public static void main(String[] args) {
class MyTimerTask exte...
分类:
其他好文 时间:
2014-05-23 01:45:11
阅读次数:
226
为什么会有线程同步的概念呢?为什么要同步?什么是线程同步?先看一段代码:package com.maso.test;
public class ThreadTest2 implements Runnable{
private TestObj testObj = new TestObj();
public static void main(String[] args) {
Thread...
分类:
移动开发 时间:
2014-05-23 01:29:34
阅读次数:
333
package com.wsy.model;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
public class ThreadScopeShareData {
static int data;
public static void main(String[] args) {
fin...
分类:
编程语言 时间:
2014-05-23 00:38:07
阅读次数:
287
这是编程之美上的一个题目:
一般的做法:
void main()
{
int a[5]={78,63,78,67,18};
int min=0,max=0;
min=max=a[0];
for(int i=0;ia[i])
min=a[i];
if(max<a[i])
max=a[i];
}...
分类:
其他好文 时间:
2014-05-22 17:04:23
阅读次数:
221
编写Test.java,编译完后生成Test.class文件,然后对该文件执行javap -c Test命令,生成字节码指令,阅读并得出结论
一、s1和s2指向常量池的不同常量
①java代码
public class Test {
public static void main(String[] args) throws IOException {
...
分类:
编程语言 时间:
2014-05-22 17:02:59
阅读次数:
434
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include
#include
using namespace std;
int main()
{
...
分类:
其他好文 时间:
2014-05-22 16:57:45
阅读次数:
202
1: %% merge.m 2: %%%%Main程序%%%%%% 3: %%%%%% 4:
%%%%%%本程序合并完各个子文件夹中的txt到主文件目录下,并且合并的文件以子文件夹名字命名 5:
%%%%%%同时,每次合并时,如果主文件夹已存在某一个子文件夹名字A的txt文件,那么此次合并,将把当前...
分类:
其他好文 时间:
2014-05-22 15:11:25
阅读次数:
334
1 #include 2 3 4 using namespace std; 5 6 void
Repeat(int* a,int Left,int Right); 7 int QuickSort(int* a,int Left,int Right); 8
9 10 void main()1...
分类:
其他好文 时间:
2014-05-22 14:53:10
阅读次数:
224
#include#includevoid main(){ char a[3]; char*str =
"adgc"; strcpy(a,str); printf("%s ",a);}程序运行的结果为什么是 adgc 呢? a的空间只有3个字符呢
,为什么可以存放str呢?望求解。
分类:
其他好文 时间:
2014-05-22 14:02:13
阅读次数:
265