To add up all the numbers in a list, you can use a loop like this: Total is initialized to 0. Each time through the loop, x gets one element...
分类:
其他好文 时间:
2014-07-16 19:29:14
阅读次数:
234
原地址:http://blog.csdn.net/armoonwei/article/details/7032537Unity as a LibraryOnce you have eclipse installed and up to date you have to follow a few st...
分类:
移动开发 时间:
2014-07-16 19:26:21
阅读次数:
246
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...
分类:
其他好文 时间:
2014-07-15 08:45:17
阅读次数:
236
1 /** 2 * Created by Administrator on 14-5-15. 3 */ 4 public class NewCow_DP { 5 public static void main(String[] args){ 6 int[] cows=n...
分类:
其他好文 时间:
2014-07-15 00:57:22
阅读次数:
267
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2014-07-14 17:31:14
阅读次数:
229
执行 service network restart 出现了网卡无法启动,说找到不到
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization
解决办法:
1》 修改/etc/udev/rules.d/70-persistent-net.rules文件,删除或...
分类:
其他好文 时间:
2014-07-14 13:36:10
阅读次数:
255
OSPF排错报告故障点一:PPP链路故障故障现象:R2和R4之间的PPP链路一会down一会UP故障分析:1) ppp 认证类型是否一致2) ppp chap认证用户是否配置正确3) pppp chap认证密码是否配置正确4) 进行chap认证的用户是否包含ppp的服务类型故障解决:1) 在RT2 ...
分类:
其他好文 时间:
2014-07-13 19:33:28
阅读次数:
284
点击打开链接
题意:有n层楼层,现在在每一层有两个按钮,分别为up和down,按动按钮时,可以向上或向下跳动num[ i ]层;问能否以最少的次数从A到B层,不能输出-1;
解析:构图,将从i层到按动按钮后跳转的楼层,看作连通状态,赋值为1,这样就转换成单源最短路问题;
#include
#include
#include
using namespace std;
const int m...
分类:
其他好文 时间:
2014-07-13 18:37:00
阅读次数:
231
1. 固定一个MAC地址,特别是在使用多个虚拟机的时候
linux环境下:
用root身份登录,在/etc/rc.d/rc.local里加上这三句
ifconfig eth0 down
ifconfig eth0 hw ether 00:0C:18:EF:FF:ED
ifconfig eth0 up
这样重新reboot后就不怕MAC复原了。
2. ifconfig命令(转...
分类:
系统相关 时间:
2014-07-13 16:14:11
阅读次数:
322
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-07-13 13:58:01
阅读次数:
184