摘要: #include #include //必须包含的头文件using namespace std;int main(){int point[10] = {1,3,7,7,9};int tmp = upper_bound(point, point + 5, 7) - point;//按从小到大,7最多能... 阅读全文
posted @ 2015-04-05 22:03 PastLIFE 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define sc(x) scanf("%d", &x) 7 #define sc2(x,y) scanf("%d%d", &x, &y) 8 #define pf... 阅读全文
posted @ 2015-04-05 22:00 PastLIFE 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define sc(x) scanf("%d", &x) 7 #define sc2(x,y) scanf("%d%d", &x, &y) 8 #define pf... 阅读全文
posted @ 2015-04-05 21:13 PastLIFE 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 给你m本书,每本a[i]页(0 2 #include 3 #include 4 #include 5 #define sc(x) scanf("%d", &x) 6 #define sc1(x) scanf("%lld", &x) 7 #define sc2(x,y) scanf("... 阅读全文
posted @ 2015-04-05 16:38 PastLIFE 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 比如 int g(int x) { return x + x; } int f() { return g(); } 这样f会调用g,然后g返回x + x给f,然后f继续把那个值返回给调用者。 如果g是inline的话。f会被直接编译成。 int f() { return x + x; } 相当于把g... 阅读全文
posted @ 2015-04-05 15:51 PastLIFE 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 主要是对于动态数组vector的用法1 基本操作(1)头文件#include.(2)创建vector对象,vector vec;(3)尾部插入数字:vec.push_back(a);(4)使用下标访问元素,cout::iterator it;for(it=vec.begin();it!=vec.en... 阅读全文
posted @ 2015-04-05 15:20 PastLIFE 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define sc(x) scanf("%d", &x) 7 #define pf(x) printf("%d\n",x) 8 #define FOR(i,b,e)... 阅读全文
posted @ 2015-04-05 14:41 PastLIFE 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define sc3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z) 6 #define pf(x) printf("%lld\n",x) 7 #defi... 阅读全文
posted @ 2015-04-05 12:44 PastLIFE 阅读(120) 评论(0) 推荐(0) 编辑