码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
字符数组在C++、C#等语言中的操作
1,C++中操作数组 #include using namespace std; int length(char []); void output_frequency(char []); int main() { char str[]="yan cong min"; cout<<"要处理的字符串为:"<<str<<endl; cout<<"字符串长度为:"<<lengt...
分类:编程语言   时间:2014-05-05 13:29:30    阅读次数:432
POJ-1011-Sticks
题目链接:http://poj.org/problem?id=1011 这道题用到了深搜+剪枝。 #include #include #include using namespace std; int a[65]; int vis[65]; int n; int cmp(int x,int y) { return x>y; } int dfs(int len,int need,int ...
分类:其他好文   时间:2014-05-05 13:28:57    阅读次数:290
codechef Factorial 算法 fread读入数据
和很多oj一样都有的经典题目,就是求阶乘的尾零有多少个。 这就不能直接求阶乘的值。而是直接求5的倍数的个数就可以了。 这个网站的数据量很大,有100000个,所以这里使用buffer,调用fread函数,可以大大加速程序。 原题: http://www.codechef.com/problems/FCTRL #include unsigned facZeros(unsig...
分类:其他好文   时间:2014-05-05 13:24:09    阅读次数:361
浅谈c语言typedef 与结构体指针(个人小经验)
?? #include #include typedef struct emp{  char sex[8];  char name[15];  int age; }*emp;//这里我们用typedef把emp这个结构体变成了*emp这种指向结构体成员的结构体指针 /*typedef struct emp{  char sex[8];  char name[15];  int...
分类:编程语言   时间:2014-05-05 12:54:29    阅读次数:277
nefu 627 剪纸游戏
题目:给定一个n*m大的纸张,上面表明了每块上的字母,在其背后给定了对应位置的字母的value,在最后给出需要剪出来的剪纸的字母序列。 方法:暴力搜索。 代码: #include #include #include #include using namespace std; char map[502][502]; int Map[502][502]; int vis[502][502...
分类:其他好文   时间:2014-05-05 12:53:36    阅读次数:338
写了一个二叉树构造及中序遍历函数
// BTree.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include"stdlib.h" #include"malloc.h" #define BT BTreeNode #define MS 10 typedef struct BT{ char data; struct BT *left; struct BT *right; }BT; ...
分类:其他好文   时间:2014-05-04 12:45:34    阅读次数:365
nefu 650 max num
题目:经典dp题目,求出最大相邻子序列的和。 方法:给出两种方法,一种dp,一种直接暴力(数据量小的时候可以考虑)。 代码1: #include #include using namespace std; int main() { int n; int t=1; cin>>n; int s[100010]; while(t<=n) { ...
分类:其他好文   时间:2014-05-03 17:02:34    阅读次数:324
fzu-1894 志愿者选拔-单调队列
转战单调队列,争取省赛前做完。。。。 这个题是很裸的单调队列。 不能用stl让人很蛋疼。。。。 就是用一个队列保存当前队伍的信息,如果来了一个大的,就把前面的小的挤掉。 #include #include #include #include #include #include using namespace std; #define maxn 55000 #define INF 99999...
分类:其他好文   时间:2014-05-03 16:28:35    阅读次数:342
C++ string中的几个小陷阱,你掉进过吗?
C++开发的项目难免会用到STL的string,使用管理都比char数组(指针)方便的多,但在得心应手的使用过程中也要警惕几个小陷阱,避免我们项目出bug却迟迟找不到原因。 1.  结构体中的string赋值问题 直接通过一个例子说明,下面的例子会输出什么: #include #include #include using namespace std; stru...
分类:编程语言   时间:2014-05-03 16:09:23    阅读次数:289
Hrbust1053 Warcraft III (完全背包)
本文出自:http://blog.csdn.net/svitter 原题:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1053 题意:完全背包不解释。。直接贴代码。。 #include #include #include using namespace std; #defi...
分类:其他好文   时间:2014-05-03 16:06:14    阅读次数:324
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!