码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
linux 中 C 语言的使用 -- 结构体多态
在 Linux 内核代码,特别是驱动代码中经常见到的用法是使用一个标准结构,后面的代码基于这个结构来实现,类似面向对象的多态特性。 在 C 语言里面借助结构体和函数指针实现的这个功能,这里我们写了个例子,提取了关键代码:    #include struct s_new{ char name[10]; char* (* my_method)(char *name);...
分类:系统相关   时间:2014-05-23 07:58:18    阅读次数:324
2014年百度之星资格赛第二题Disk Schedule
其实我觉得这题可以用费用流的,可是光建图就超时了。。。不科学啊。。。因为边太多了,不然一定能过的,最后想啊想,还是用dp吧。。。。 居然想到一种一维dp。。。。我也不知道我怎么想的,反正就是ac了 //#pragma comment(linker, "/STACK:102400000,102400000") #include #include #include #include #includ...
分类:其他好文   时间:2014-05-22 13:20:14    阅读次数:286
VS2010中wmain入口函数中使用wprintf输出中文乱码问题
正确代码:#include "stdio.h" #include "Windows.h" #include int wmain(int argc, wchar_t* argv[]) { setlocale(LC_ALL, "chs"); wprintf(L"%s\n", L"中文字符"); }其关键代码为:setlocale(LC_ALL, "chs");配置地域化信息函数为什么一定要调用...
分类:其他好文   时间:2014-05-22 13:02:06    阅读次数:254
湖南省第九届大学生程序设计竞赛
Interesting Calculator CSU 过了 TOJ超时了 先记一下 #include #include #include using namespace std; int a[100]; bool b[100010]; int c[100010]; int d[100010]; int x, y; int cas = 1; struct node { int x, t,...
分类:其他好文   时间:2014-05-22 12:42:02    阅读次数:249
2014华为实习上级笔试题-- 统计字符串中出现的单词
#include //#include using namespace std;     struct node {       char word[10];     int num; }; node obj[100];   void my_word(char input[], char output[]) {    int sum=0,flag=0;...
分类:其他好文   时间:2014-05-22 12:41:25    阅读次数:233
POJ 3070 Fibonacci
Sol:就是求第N项的斐波那契数。矩阵乘法+快速幂 #include #include #include #include using namespace std; #define LL long long struct Mat{ LL f[2][2]; }; LL MOD = 10000; Mat mul(Mat a,Mat b) { LL i,j,k...
分类:其他好文   时间:2014-05-22 10:46:35    阅读次数:191
字符串四则运算
#include//中缀表达式求值 #include using namespace std;   int precede(char t1,char t2) //shuru//判断优先级 {     int t=0;     switch(t2)     {     case '+':     case '-':             if(t1=='(...
分类:其他好文   时间:2014-05-22 07:48:44    阅读次数:237
2014华为实习上级笔试题——三天打鱼两天晒网
#include using namespace std; int func(int year)//判断闰年的个数 {     int count=0;     for(int i=1990;i         if(year%4==0&&year%100!=0||year%400==0)             count++;         return cou...
分类:其他好文   时间:2014-05-22 06:34:15    阅读次数:252
复数运算
#include #include using namespace std; struct node   { int shi; int xu; int data; }; int main() {     int shinum=0;     int xunum=0;     int n;     cin>>n;     node*num=ne...
分类:其他好文   时间:2014-05-20 15:28:05    阅读次数:256
c++学习笔记4,派生类的构造函数与析构函数的调用顺序(一)
测试源码: //测试派生类的构造函数的调用顺序何时调用 //Fedora20 gcc version=4.8.2 #include using namespace std; class base { public: base() { cout<<"base created!"<<endl; } ~base() { cout<<"base destroyed!"<<en...
分类:编程语言   时间:2014-05-20 14:12:21    阅读次数:322
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!