1.提取字符串2.提取指定长度的字符串3.提取指定字符为止的字符串4.取仅包含指定字符集的字符串5.取到指定字符集为止的字符串#include
int main(){ char str[512]={0}; sscanf("123456","%s",str); printf("str...
分类:
其他好文 时间:
2014-05-12 17:15:19
阅读次数:
322
#include using namespace std;/** * this 指针理解
*/class A{ int i;public: void hello(){
couthello();}由于单独开发基于c++的编译器,c++程序翻译成c程序后在,在使用c语...
分类:
编程语言 时间:
2014-05-12 16:34:20
阅读次数:
283
这里把EEPROM
24c02封装起来,今后可以直接调用,其连线方式为:SDA-P2.1;SCL-P2.0;WP-VCC>__ //头文件的包含 7 #include 8
#define _Nop() _nop_() //定义空指令 9 /*----------...
分类:
其他好文 时间:
2014-05-12 16:04:34
阅读次数:
427
题目链接构造矩阵 看的题解,剩下的就是模板了,好久没写过了,注意取余。#include
#include #include #include #include #include #include using namespace
std;#define MOD 10007#define LL __in...
分类:
其他好文 时间:
2014-05-10 19:55:41
阅读次数:
262
一.内存对齐的初步讲解内存对齐可以用一句话来概括:“数据项只能存储在地址是数据项大小的整数倍的内存位置上”例如int类型占用4个字节,地址只能在0,4,8等位置上。例1:#include
struct xx{ char b; int a; int c; char d;};int main(){ st...
分类:
其他好文 时间:
2014-05-10 19:52:54
阅读次数:
323
个线程都有一个唯一的 ID 以识别不同的线程,std:thread 类有一个 get_id()
方法返回对应线程的唯一编号,你可以通过 std::this_thread 来访问当前线程实例,下面的例子演示如何使用这个 id:#include
#include #include void hello....
分类:
其他好文 时间:
2014-05-10 19:36:43
阅读次数:
281
Mark。看着吴神博客写的,还未完全懂。 1 #include 2 #include 3
#include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10
#include 11 #includ...
分类:
其他好文 时间:
2014-05-06 09:08:25
阅读次数:
286
题目链接:http://acm.upc.edu.cn/problem.php?id=2224题意:给出n个数pi,和m个查询,每个查询给出l,r,a,b,让你求在区间l~r之间的pi的个数(A#include
#include #include #include #define lson rt>1;...
分类:
其他好文 时间:
2014-05-06 08:53:03
阅读次数:
248
这个题网上很多人都说用状态压缩dp来做,我就是觉得状态压缩dp有点那么理解不上啊,不过如果这个题吧相邻的两个格子连起来,那不就是求最大权独立点集吗?奋战了三天,我的第一道最大流题目终于写出来了,高兴啊!#include#include#include#include#include#include#...
分类:
其他好文 时间:
2014-05-06 08:51:34
阅读次数:
288
#include #include float get_cpu_clock_speed(){ FILE
*fp; char buffer[1024]; size_t bytes_read; char *match; float clock_speed;
fp=fo...
分类:
其他好文 时间:
2014-05-02 14:20:39
阅读次数:
392