OJ题目 : 
click here~~
题目分析:给一个数字三角形,从最上面一个数字开始,方向只能往左下或者右下,一直到最后一行,求经过的所有数字和的最大值。
搞清楚在输入的数据中,route的方向就行。
AC_CODE
int num[102][102];
int   main(){
      int n  , i , j , k ;
      while(cin >> n){
...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 23:05:55   
                                阅读次数:
372
                             
                    
                        
                            
                            
                                普通排序:直接分配一个同等大小的数组,反向copy即可.char* Reverse(char* 
s){ //将q指向字符串最后一个字符 char* q = s ; while( *q++ ) ; q -= 2 ; //分配空间,存储逆序后的字符串。 
char* p = newchar[sizeof(...
                            
                            
                                分类:
其他好文   时间:
2014-05-12 16:30:14   
                                阅读次数:
338
                             
                    
                        
                            
                            
                                前面已经说过选择结构了其实他和for相差不是太大,现在就来说说循环结构。循环结构有三种形式!1 
for 2.while 3.do while 这三种都可以循环,不过他们之间还是有区别的,for和while是要先验证条件,如果条件满足才执行循环体,而后者do 
while是不管条件是否满足都要执...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 20:03:50   
                                阅读次数:
326
                             
                    
                        
                            
                            
                                Android 加载项目失败: sdk/build-tools/android-4.4.2/aapt: 
error while loading shared libraries: libz.so.1: cannot open shared object file: 
No such file or ....
                            
                            
                                分类:
移动开发   时间:
2014-05-06 09:19:19   
                                阅读次数:
418
                             
                    
                        
                            
                            
                                1)循环语句while,do/while,for 
格式:while(布尔表达式){循环体语句}//先验循环,可执行0次或n次,若布尔表达式第一次为false,永不执行循环体语句 
do{循环体语句}while(布尔表达式);//后验循环,可执行一次或n次,且至少执行一次 for(初始化;布尔表达式;变...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 09:15:17   
                                阅读次数:
254
                             
                    
                        
                            
                            
                                代码:
#include 
#include 
#include 
#include 
using namespace std;
const int maxn=10003;
const int inf=0x7fffffff;
int num[maxn];
int n;
int main()
{
    while(scanf("%d",&n)!=EOF&&n)...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 12:39:16   
                                阅读次数:
331
                             
                    
                        
                            
                            
                                题目:经典dp题目,求出最大相邻子序列的和。
方法:给出两种方法,一种dp,一种直接暴力(数据量小的时候可以考虑)。
代码1:
#include 
#include 
using namespace std;
int main()
{
    int n;
    int t=1;
    cin>>n;
    int s[100010];
    while(t<=n)
    {
 ...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 17:02:34   
                                阅读次数:
324
                             
                    
                        
                            
                            
                                一,socket 模块
套接字包括两类:服务器,客户机,
创建一个套接字后让它等待连接
服务器:
import socket
s = socket.socket()
port = 1234
host = socket.gethostname()
print host
s.bind((host,port))
s.listen(5)
while True:
    get,addr = s...
                            
                            
                                分类:
编程语言   时间:
2014-05-02 21:59:57   
                                阅读次数:
444
                             
                    
                        
                            
                            
                                问题描述:
在Eclipse中运行ant批量打包工具出错,日志信息如下:
D:\Android\android-sdk-windows\tools\ant\build.xml:601: The following error occurred
 while executing this line:
D:\Android\android-sdk-windows\tools\ant\bui...
                            
                            
                                分类:
移动开发   时间:
2014-04-30 22:48:39   
                                阅读次数:
359
                             
                    
                        
                            
                            
                                ./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory...
                            
                            
                                分类:
其他好文   时间:
2014-04-30 22:43:38   
                                阅读次数:
346