struct类型适于表示Point、Rectangle和Color等轻量对象。尽管使用自动实现的属性将一个点表示为类同样方便,但在某些情况下使用结构更加有效。例如,如果声明一个 1000 个Point对象组成的数组,为了引用每个对象,则需分配更多内存;这种情况下,使用结构可以节约资源。因为 .NET...
分类:
其他好文 时间:
2014-08-11 21:06:22
阅读次数:
204
求有序数列的排列数如{1,2,3,4,5}的排序数目{1},{2},{3},{4},{5},{1,2},{1,3},{1,4}......代码:#include #include #include #include using namespace std;struct node{ int val, ...
分类:
其他好文 时间:
2014-08-11 20:38:42
阅读次数:
184
作者:zccst1,下载安装nodejs安装完毕,通过cmd.exe查看node -v正常npm 时报错:nodejs/windows Error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm'解决办法:Manually creating a fold...
#stat命令:查看文件信息[root@VM_168_102_centos~]#stattest.log
File:`test.log‘
Size:0Blocks:0IOBlock:4096regularemptyfile
Device:ca01h/51713dInode:483339Links:1
Access:(0644/-rw-r--r--)Uid:(0/root)Gid:(500/wanghan)
Access:2014-08-1114:27:24.000000000+0800
Mo..
分类:
系统相关 时间:
2014-08-11 18:15:14
阅读次数:
527
笔记:在linux应用程序中延时有sleep()、msleep()和usleep()函数之类的延时,也有如下形式的延时: struct timeval delay;
delay.tv_sec = sleepSecond;
delay.tv_usec = 0;
select( 0, NULL, NULL, NULL, &delay );但是基本上都是基于进程休眠的,好像...
分类:
系统相关 时间:
2014-08-11 18:06:32
阅读次数:
323
原与紫书。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
struct Point
{
int x, y;
Point( int x=0, int y=0 ) : x(x), y(y){}...
分类:
其他好文 时间:
2014-08-11 18:04:12
阅读次数:
284
程序中包含了递归方法 和循环方法#include
#include
using namespace std;
struct tree
{
int value;
tree *left;
tree *right;
};
tree *create()
{
int n;
cin>>n;
if (n == 0)
{
return NULL;
}
else
{
tree *ro...
分类:
其他好文 时间:
2014-08-11 17:56:42
阅读次数:
223
struct ListNode
{
int m_nValue;
ListNode* m_pNext;
};
//增加节点
/*第一个参数是一个指向指针的指针。当我们往一个空链表中插入一个节点时,新插入的节点
就是链表的头指针。由于此时会改动头指针,因此必须把pHead参数设为指向指针的指针*/
void addToTail(ListNode** pHead, int value) ...
分类:
其他好文 时间:
2014-08-11 15:00:22
阅读次数:
307
问题描述:层遍历二叉树,同一层从左往右打印。定义二元查找树的结点为:typedef struct BSTreeNode { int data; BSTreeNode *left; BSTreeNode *right;} Node;例如输入二叉树:6/ \4 12/ \ / \25...
分类:
其他好文 时间:
2014-08-11 14:40:32
阅读次数:
173
基本小圆覆盖模板题#include #include #include using namespace std;int X,Y; int n;const double eps=0.00000001;struct point{ double x,y;}p[550]; struct Circle{...
分类:
其他好文 时间:
2014-08-11 14:25:02
阅读次数:
228