码迷,mamicode.com
首页 >  
搜索关键字:iostream    ( 13291个结果
大数幂取模
//大数幂取模 #include "iostream" using namespace std; //(a^b) % m int mod(int a,int b,int m){ int result = 1; for(int i=0;i<b;i++) { result = (result*a) %m; } return result; } in...
分类:其他好文   时间:2015-01-22 01:50:13    阅读次数:189
hdu1285拓扑排序
1 #include "iostream" 2 #include "vector" 3 #include "memory.h" 4 #include "cstdio" 5 using namespace std; 6 #define swap(a,b,t) ( (t) = (x),(x) = (y....
分类:编程语言   时间:2015-01-22 00:06:45    阅读次数:174
hdu2063 过山车(最大二分匹配)
强烈推荐的匈牙利算法介绍:http://www.renfei.org/blog/bipartite-matching.html 1 #include "iostream" 2 #include "vector" 3 #include "memory.h" 4 using namespace std;...
分类:其他好文   时间:2015-01-21 19:34:51    阅读次数:253
windows模拟键盘事件,无光标聚焦,按下键盘就能保存按下的键盘字符
#include #include #include #include #include #include #include using namespace std; const int KeyBoardValue = 0x80000000; string GetKeyName(int); bool JudgeShift(); int main() { string FileName ...
分类:Windows程序   时间:2015-01-21 15:20:48    阅读次数:280
求10000以内的素数
#include "iostream" #include "cmath" #include "memory.h" using namespace std; const int Max = 10000; bool numbers[Max]; void searchprime(){ memset(numbers, true, sizeof(numbers)); for (int i = 2; ...
分类:其他好文   时间:2015-01-21 10:21:09    阅读次数:135
利用哈弗曼编码进行压缩
//sZipDemo.cpp:定义控制台应用程序的入口点。 // #include"stdafx.h" #include"HuffmanTree.cpp" #include"sZip.h" #include<fstream> #include<iostream> usingnamespacestd; int_tmain(intargc,_TCHAR*argv[]) { charstr1[10000]; ifstreamin; in.open("..
分类:其他好文   时间:2015-01-21 06:39:12    阅读次数:339
指向成员的指针
#include<iostream>usingnamespacestd;classData{public: inta; intb; intc;public: Data():a(0),b(0),c(0){} voidprintf(){cout<<"a="<<a<<",b="<<b<<",c="<<c<<endl;}};intmain(){ Datax; Data*y=&x; intData::*pDataIn..
分类:其他好文   时间:2015-01-15 11:07:34    阅读次数:149
1155. Can I Post the lette
#include "iostream" #include "memory.h" #include "cstdio" using namespace std; int road[201][201]; int n, m; /* 利用弗洛伊德算法来解这道题,如果两个城市可以连通, 则其距离为0 */ inline void floyd(){ for (int i = 0; i < n; i++){ ...
分类:其他好文   时间:2015-01-13 23:24:40    阅读次数:396
1310. Right-Heavy Tree
#include "iostream" #include "cstdio" using namespace std; struct Node{ int val; Node *left, *right; Node(int v = 0){ val = v; left = NULL; right = NULL; } }; inline void preOrder(Node *he...
分类:其他好文   时间:2015-01-13 21:44:22    阅读次数:184
1090. Highways
#include "iostream" #include "memory.h" #include "cstdio" using namespace std; int grap[500][500]; int ans; int dis[500]; bool visited[500]; void prime(int n){ int source = 1; for (int i = 1; i <=...
分类:其他好文   时间:2015-01-13 21:39:05    阅读次数:153
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!