码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
HDU 4864 Task
贪心,排序,二分。。。#include #include #include #include #include using namespace std;const int maxn = 200010;struct node { int x,y; int price; int mak...
分类:其他好文   时间:2014-07-23 15:49:19    阅读次数:216
枚举根据ID输出文本值,获取枚举对应的值
public enum BookingStatus { 未提交 = 1, 已提交, 已取消, 已订妥 = 6}我们想在页面输出一个订单的状态时,可以这样:HotelOrder myOrder = GetItem(orderId); //获取一个订单对象lbStatus.Text = ((Bookin...
分类:其他好文   时间:2014-07-23 15:21:46    阅读次数:216
静态构造函数到底执行了多少次?
我们知道对于class和struct都可以定义构造函数,而构造函数又有实例构造函数和静态构造函数。实例构造函数在每次实例化时,都会执行一次。那静态构造函数是否如此呢?我们先来看一段代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Thread...
分类:其他好文   时间:2014-07-23 13:20:16    阅读次数:198
hdu 1864最大报销额 (01背包模板)
//注意将价格转化为整数即可 # include # include # include using namespace std; int max(int a,int b) { return a>b?a:b; } int dp[3000050]; int main() { int n,i,j,flag,l,m; int suma,sumb,sumc,sum; double q,...
分类:其他好文   时间:2014-07-23 13:15:36    阅读次数:177
跑骚时刻 - C笔记:赫夫曼编码
#include #include #include #include #pragma warning(disable:4996)typedef struct HuffmanTree{ int weight;//权值 int parent;//父节点 int left;//左子树 ...
分类:其他好文   时间:2014-07-23 12:49:56    阅读次数:382
【HDOJ】2371 Decode the Strings
快速矩阵乘法。注意,原始字符串即为decode后的字符串。题目是要找到原始串。 1 #include 2 #include 3 4 #define MAXN 85 5 6 typedef struct { 7 char m[MAXN][MAXN]; 8 } mat_st; 9 10 ...
分类:其他好文   时间:2014-07-23 12:38:56    阅读次数:259
UvaOJ 10167
暴力搜索 1 #include 2 3 struct node 4 { 5 int x; 6 int y; 7 }s[10000]; 8 int main() 9 {10 //freopen("input.txt","r",stdin);11 int a,b,n,n...
分类:其他好文   时间:2014-07-23 11:58:36    阅读次数:293
链表(五)——单向循环链表
1.单向循环链表 区分单向链表和单向循环链表:单向循环链表的尾指针指向头结点。 2.单向循环链表的基本操作 #include #include #define NULL 0 typedef struct node { int data; struct node *next; }ElemSN; ElemSN * creat_link(int ms); //创建一个单向循环链表 ...
分类:其他好文   时间:2014-07-22 23:50:48    阅读次数:264
结构体大小求值
?? 内存对齐概念,struct例子: struct stu{   char a;    intb;   char c;   double d;   char e; } 取pack(n),n,取结构体中最大成员大小m,取两个小值k, k = m 取每个成员大小p,依次同k比较,取小值q = k 第二步当中依次取...
分类:其他好文   时间:2014-07-22 23:48:17    阅读次数:283
ACM基础训练题解4301 城市地平线
遍历线段树 线段树的插入和查询 1 //城市地平线(线段树) 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 typedef __int64 LL; 9 struct building{....
分类:其他好文   时间:2014-07-22 23:08:12    阅读次数:175
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!