原文:IntelliJ IDEA导出Java 可执行Jar包 保证自己的Java代码是没有问题的,在IDEA里面是可以正常运行的,然后,按下面步骤: 打开File -> Project Structure -> Artifacts,如下图 IDEA导出Java 可执行Jar包" title="Int...
分类:
编程语言 时间:
2015-07-11 18:13:16
阅读次数:
134
链接:点我就是自己写不出来 1 #include 2 #include 3 #include 4 using namespace std; 5 const int MAX = 23; 6 7 int dp[MAX][MAX]; 8 int pos[MAX][MAX]; 9 int val[M...
分类:
其他好文 时间:
2015-07-11 18:11:02
阅读次数:
126
代码一: 1 #include 2 void int_clk() 3 { 4 BCSCTL1 &= ~XT2OFF; 5 BCSCTL2 |= SELM_2 + SELS; 6 do 7 { 8 IFG1 &= ~OFIFG; 9 for(int i=0;i 2 ...
分类:
其他好文 时间:
2015-07-11 18:09:48
阅读次数:
120
解法一:基于递归求骰子点数
void PrintProbability(int number)
{
if (number
return;
int maxSum = number*g_maxValue;
int* PrintProbability = new int[maxSum - number + 1];
for (int i = number; i
pProba...
分类:
其他好文 时间:
2015-07-11 16:53:04
阅读次数:
146
前言:《effective Java》一书确实经典,真是为没有早一点买到这本书而感到遗憾。再来学习一个小知识,在之前,我只是知道integer是int的装箱类,而int是基本类型而已,从来没有意识到自动装箱有这么大的区别,“要优先使用基本类型而不是装箱基本类型,要当心无意识的自动装箱。”...
分类:
编程语言 时间:
2015-07-11 16:47:52
阅读次数:
110
和上一题 “照明系统设计”类似,我们可以逐步递推出最优解,d[i] 表示1~i个字符的最优解,那么d[i] = min(d[i],d[j] + 1)|当s[j+1~i]为回文串时。
大家可以自行打印d这个数组,来体会一下状态的转移情况。
代码如下:
#include
using namespace std;
const int maxn = 1000 + 10;
const int INF ...
分类:
其他好文 时间:
2015-07-11 16:46:42
阅读次数:
121
本文简要介绍Java并发编程方面常用的类和集合,并介绍下其实现原理。AtomicInteger可以用原子方式更新int值。类 AtomicBoolean、AtomicInteger、AtomicLong 和 AtomicReference 的实例各自提供对相应类型单个变量的访问和更新。基本的原理都是...
分类:
编程语言 时间:
2015-07-11 16:37:19
阅读次数:
163
题意:给出杨辉三角的层数k,返回最后一层。k=0时就是只有一个数字1。思路:滚动数组计算前一半出来,返回时再复制另一半。简单但是每一句都挺长的。 1 class Solution { 2 public: 3 vector getRow(int rowIndex) { 4 if...
分类:
其他好文 时间:
2015-07-11 16:35:18
阅读次数:
138
1、单个的字符或者数字 void swap(int *a,int *b) { int temp=*a; *a=*b; *b=temp; } int main() { int a=10,b=100; swap(&a,&b); cout<<a<<"\t"<<b<<endl; return 0; } 2、...
分类:
其他好文 时间:
2015-07-11 16:28:59
阅读次数:
172
/* SList.cpp Author: Qiang Xiao Time: 2015-07-11*/#includeusing namespace std;const int MAX_LENGTH= 20;class SList{ private: int max_len...
分类:
编程语言 时间:
2015-07-11 15:07:12
阅读次数:
151