求变量的数据类型,通过函数typeid(变量名).name();获得变量的数据类型。
案例如下:
#include
#include
void
main()
{
double
db = 10.9;
double *pdb
= &db;
auto
num =
pdb;
//...
分类:
编程语言 时间:
2014-08-17 02:36:51
阅读次数:
402
poj 3237 tree inline : 1. inline 定义的类的内联函数,函数的代码被放入符号表中,在使用时直接进行替换,(像宏一样展开),没有了调用的开销,效率也很高。 2. 很明显,类的内联函数也是一个真正的函数,编译器在调用一个内联函数时,会首先检查它的参数的类型,保证调用正确。然...
分类:
其他好文 时间:
2014-08-17 01:05:41
阅读次数:
240
题目链接:点击打开链接
题意就是求最大面积
枚举每个柱子作为起点
然后二分两边长度。 求个区间最值。
#include
#include
#include
using namespace std;
#define ll long long
#define N 100100
inline bool rd(int &n){
int x = 0, tmp = 1;
...
分类:
其他好文 时间:
2014-08-16 18:34:41
阅读次数:
228
对于像UVA 11987 Almost Union-Find这样的题目,要求把一个元素从一个集合中剥离的情况,我们只需要新建一个节点然后………. 还是看代码吧: inline void move(int x,int y) // 把x从y集合中剥离{ int fx = find(id[x]),fy =...
分类:
其他好文 时间:
2014-08-16 14:58:50
阅读次数:
231
一些比较水的博弈论...(为什么都没有用到那什么SG呢....)TYVJ 1140 飘飘乎居士拯救MM题解: 歌德巴赫猜想 1 #include 2 #include 3 4 int n, a, b, ta, tb; 5 6 inline bool isPrime(int x){ 7 ...
分类:
其他好文 时间:
2014-08-15 14:09:58
阅读次数:
158
今天做项目的时候碰到了不固定元素个数,需要水平居中的问题,原来的确定宽度下margin:0 auto等方法木有用了。想起来之前看过display:inline-block的文章,果断用这个。之前很少用这个属性。。印象里麻烦比较多。。好了不多说了,上代码。 1 2 3 4 5 ...
分类:
其他好文 时间:
2014-08-14 23:15:53
阅读次数:
239
<tdstyle="word-break:break-all">强制换行<tdstyle="width:80px;display:block;boverflow:hidden;">超出隐藏,注意要设置宽度。内联转化为块状:display:block或float:left/right块状转化为内联:display:inline;但是要注意内联元素是不能设置宽度和高度的。那就..
分类:
其他好文 时间:
2014-08-14 04:04:48
阅读次数:
554
先贴自己类比二维树状数组写的三维树状数组模板: 开始的时候循环体内j=y,k=z,没写,以为自己思路错了,,,hehe.....
更高维的树状数组以此类比
const int MAXN = 100+10;
int c[MAXN][MAXN][MAXN];int X,Y,Z;
int N;
inline int lowbit(int x){return x&(-x);}
void up...
分类:
其他好文 时间:
2014-08-13 19:00:37
阅读次数:
189
Problem Description
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same...
分类:
其他好文 时间:
2014-08-13 18:59:07
阅读次数:
226
1、java持久层使用mybatis,sql报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Improper inline pa...
分类:
数据库 时间:
2014-08-13 18:42:06
阅读次数:
282