#ifndef _BIN_TREE_H
#define _BIN_TREE_H
#include
#include
#include
struct _Tree_node
{
int data;
struct _Tree_node *left;
struct _Tree_node *right;
};
typedef int element_type;
t...
分类:
其他好文 时间:
2015-04-13 20:56:40
阅读次数:
122
今天看到《C++Primer》上写*p++等价于先运算p++然后再进行解引用计算,想了一会儿,又去网上查了查,不过发现说法不一,还有争论得不可开交的...
于是,本人默默的打开了VS...
还是亲测一下最好
#include "stdafx.h"
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
...
分类:
其他好文 时间:
2015-04-13 20:56:32
阅读次数:
123
反汇编一个简单的C程序
看了下网易云课堂的《Linux内核分析》,第一节要求有一个简单C程序得到汇编代码,然后分析。只要明确每个汇编指令代表的含义,就可以容易的走下去,关键是要体会里面的思想。
int g(int x){
return x+3;
}
int f(int x){
return g(x);
}
int main(){
return f(8...
分类:
其他好文 时间:
2015-04-13 20:53:15
阅读次数:
243
static void Main(string[] args) //记住格式 { int n = 0; for (int x = 1; x * 2 <= 100; x++) { for (int y = 1; y * 1 <= 100; y++) { for (int z = 1; z * 0......
分类:
其他好文 时间:
2015-04-13 20:50:46
阅读次数:
130
BZOJ1188: [HNOI2007]分裂游戏首先我们可以认为每一个石子都是一个独立的游戏(因为石子之间互不影响),那么我们用sg[i]表示处在i位置的一个石子的sg函数值,那么我们就可以枚举它的后继状态从而计算它的sg函数值。最后累加ans即可。 1 int v[100],sg[100],a[1...
分类:
其他好文 时间:
2015-04-13 20:50:21
阅读次数:
111
static void Main(string[] args) { while (true) { try { int i = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("无异常"); } catch (Exception) {...
分类:
其他好文 时间:
2015-04-13 20:49:31
阅读次数:
107
1 #include 2 using namespace std; 3 4 5 int main() 6 { 7 const int i=42; 8 auto j=i; 9 const auto &k=i;10 auto *p=&i;11 co...
分类:
其他好文 时间:
2015-04-13 20:43:44
阅读次数:
108
两个栈来模拟浏览器的操作,简单模拟。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 stack forward; 7 stack back; 8 9 int main ()10 {11 string cur(...
分类:
其他好文 时间:
2015-04-13 20:41:47
阅读次数:
107
create table persons(Name nvarchar(32) not null); goinsert into persons(Name) values('张三'),('李四'),('王五'); godeclare @i as int =1;--循环计数器 declare @rows...
分类:
数据库 时间:
2015-04-13 20:40:22
阅读次数:
119
while (true) { Console.WriteLine("请为五位同学开始投票(0/1/2/3/4):"); int[] vote = new int[5];//给五个人投票,定义一个长度为5的数组,每一个下标代表一个人 for (int i = 0; i 4) { Conso...
分类:
其他好文 时间:
2015-04-13 20:38:08
阅读次数:
126