码迷,mamicode.com
首页 >  
搜索关键字:num    ( 9856个结果
最小生成树-Prim算法
【问题】 求一个给定的加权连通图的最小生成树问题。 【代码】 #include #include #define MAXNUM 1000 #define MAX_VERTEX_NUM 20 typedef char Vertextype; typedef struct node { int weight; }Adjmatrix[MAX_VERTEX_NUM][MAX_VERT...
分类:其他好文   时间:2014-05-13 23:55:49    阅读次数:464
【从0开始Tornado建站】群聊
群聊的前台主要代码: {%block content%} 测试版本,每天凌晨4:00清水,enjoy it~~:-)--> {%for i in content[19*int(num)-19:19*int(num)]%} 【{{i[1]}}】 ({{i[3]}}) : {{i[2]}} {%end%} {%for i in range(1,pages+1)%} {{i}} {%...
分类:其他好文   时间:2014-05-13 23:14:45    阅读次数:388
switch
$num = 22switch ($num){1{Write-Host "this is 1";break}2{Write-Host "this is 2" 1+2 break}default{Write-Host "cpp";break}}
分类:其他好文   时间:2014-05-13 19:57:21    阅读次数:203
算法导论—排序之插入排序
//升序void insertion_sort(vector &num){ for(int i = 1; i =0 && num[j] >= val){ num[j+1] = num[j];...
分类:其他好文   时间:2014-05-13 11:42:59    阅读次数:190
reloadSections
self.isOpen = [NSMutableArray array];     for (int j = 0; j         [self.isOpen addObject:[NSNumber numberWithInt:0]];     } -(void)buttonClick:(UIButton*)button {        NSNumber *num ...
分类:其他好文   时间:2014-05-13 08:12:11    阅读次数:264
字符串/数字之间类型转换总结
1、char向int转换 方法一:(适用于单个字符) char ch = '6'; int num = ch - '0';   //此时num=6 方法二:(适用于字符串) 函数atoi: int atoi ( const char * str ); 参数是一个char类型的数组,不能是单个char变量 char str[10] = "32352"; int num = atoi(...
分类:其他好文   时间:2014-05-13 06:55:14    阅读次数:362
USACO dualpal
/* ID:kevin_s1 PROG:dualpal LANG:C++ */ #include #include #include #include #include using namespace std; int N,S; vector result; bool isPalindromic(string num){ bool flag = true; int len =...
分类:其他好文   时间:2014-05-13 06:10:09    阅读次数:312
查询博客中相同文章类别总共有多少文章
查询博客中相同文章类别总共有多少文章  T_Content 博客表 T_ContentType 博客类别表 string sql = "select  (select  count(*) from T_Content where FTypeId=T.FID) as num from T_ContentType AS T"...
分类:其他好文   时间:2014-05-12 07:00:52    阅读次数:294
Python写的一个优美的定时器,定时精度可调
# -* coding: utf-8 -*- import sys import os import getopt import threading import time def Usage(): usage_str = '''说明: \t定时器 \timer.py -h 显示本帮助信息,也可以使用--help选项 \timer.py -d num 指定一个延时时间(以毫秒为单位)...
分类:编程语言   时间:2014-05-12 06:29:06    阅读次数:428
UVA 11361 - Investigating Div-Sum Property(数位DP)
题目链接:11361 - Investigating Div-Sum Property 白书上的例题,不过没有代码,正好前几天写了一题数位DP的题目,这题也就相对轻松了。 dp[i][x][y]表示加到第i位,数字 % k,数位和 % k的组合情况数,那么现在要添加一个0 - 9的数字上去状态转移为 dp[i + 1][(x * 10 + num) % k][(y + num) % k],计...
分类:其他好文   时间:2014-05-11 05:23:33    阅读次数:316
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!