加上两个下划线变量或者方法变为私有。 >>> class Bird: ... __song = "spark" ... def sing(self): ... return self.__song ... >>> b = Bird() >>> b.sing() 'spark' ...
分类:
编程语言 时间:
2014-08-10 18:12:40
阅读次数:
284
/**
* 功能:内存存放地址的地方
* 时间:2014年7月31日09:50:10
* 作者:cutter_point
*/
#include
using namespace std;
//全局变量的存放地点
int dog, cat, bird, fish;
//函数存放内存地点
void f(int pet)
{
cout<<"pet id number: "<<pet<<e...
分类:
编程语言 时间:
2014-08-10 13:05:40
阅读次数:
249
1.安装交叉编译工具arm-linux-gcc2.下载net-snmp源码安装包3.解压安装包4../configure --build=i686-linux --host=arm-linux CC=arm-linux-gcc --with-endianness=little --enable-mi...
分类:
Web程序 时间:
2014-08-10 12:34:50
阅读次数:
388
_(:3 ⌒?)_ 调我半天,还是记录下吧。用轻重链可解决此题。用轻重链的方式给点重新编号后,建两棵线段树,一棵(sumTree)用于记录路径修改,另外一棵(markTree)用于记录邻边修改的点。然后维护下两棵树即可。注意,markTree修改时,要在sumTree上修改第一个点和最后一个点对应的...
分类:
其他好文 时间:
2014-08-07 22:52:55
阅读次数:
447
在我正看着roll神的博客的时候发现了自己的错误#include #include #include #include #include #include #include #include #include #include #include #include #include using n.....
分类:
其他好文 时间:
2014-08-07 18:28:20
阅读次数:
156
1 #!/bin/bash - 2 #=============================================================================== 3 # 4 # FILE: hex_change.sh 5 # 6 # ...
分类:
系统相关 时间:
2014-08-07 02:58:48
阅读次数:
384
thinking more after reading. Don't just read the papers.in addition, at begining, you'd better focus on abstract, introduction and discussion. little ...
分类:
其他好文 时间:
2014-08-06 22:47:12
阅读次数:
402
Tree Recovery
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11365
Accepted: 7128
Description
Little Valentine liked playing with binary trees very much...
分类:
其他好文 时间:
2014-08-06 19:02:12
阅读次数:
233
Description
Linda is a teacher in ACM kindergarten. She is in charge of n kids. Because the dinning hall is a little bit far away from the classroom, those n kids have to walk in line to the dinnin...
分类:
其他好文 时间:
2014-08-06 10:37:51
阅读次数:
257
题目大意是,n只猫,有k个动作让它们去完成,并且重复m次,动作主要有三类gi,ei,s i j,分别代表第i只猫获得一个花生,第i只猫吃掉它自己所有的花生,第i只和第j只猫交换彼此的花生。k,n不超过100,m不超过1000,000,000,计算出最后每只猫还剩下多少个花生。
我们假设一个n维向量P,每个分量的值代表这n只猫所拥有的花生数,那么对于gi操作其实就是在第i维分量上加...
分类:
其他好文 时间:
2014-08-05 22:44:10
阅读次数:
333