码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
用C++编程 输入10个数字,放在一个数组中,找出其中最小的值,输出这个值以及它在数组中的下标
1 #include 2 using namespace std; 3 int main() 4 { 5 int a[10],min,i,xb; 6 cout>a[i]; 9 min=a[0];10 xb=0;11 for(i=0;i<10;i++)12 {13 if(a[i]<m...
分类:编程语言   时间:2015-05-12 13:09:52    阅读次数:108
第一个C语言程序
1 /* 第一个C语言程序2 打印 Hello, world */3 #include //包含头文件stdio.h4 int main(){ // 主函数5 printf("Hello, word\n"); // 打印字符串6 return 0; // 返回0,表示程序正确...
分类:编程语言   时间:2015-05-12 13:07:44    阅读次数:140
HDU 2188 悼念512汶川大地震遇难同胞——选拔志愿者(巴什博弈,水)
思路:若能给对方留下m+1,就可以胜。否则败。 1 #include 2 using namespace std; 3 int main() 4 { 5 int t,n,m;cin>>t; 6 while(t--) 7 { 8 cin>>n>>m; 9 ...
分类:其他好文   时间:2015-05-12 13:05:44    阅读次数:90
HDU Rabbit and Grass 兔子和草 (Nim博弈,水)
思路:简单Nim博弈,只需要将所给的数字全部进行异或,结果为0,则先手必败。否则必胜。知道方法的人1分钟写完代码,不知道的人研究几小时都难写。 1 #include 2 using namespace std; 3 int main() 4 { 5 //freopen("input.txt...
分类:其他好文   时间:2015-05-12 13:01:04    阅读次数:101
c++ break while
#include #include #include #include "destory_free_while.h"using namespace std;Worker::Worker() { shutdown = false; num_thread = 10;}void Worker:...
分类:编程语言   时间:2015-05-12 12:57:06    阅读次数:153
网络流模板
#include using namespace std; #define INF 0x7ffffff #define maxn 100000 struct Edge { int from, to, cap, flow; Edge(int u, int v, int c, int f):from(u), to(v), cap(c), flow(f){} }; int n, ...
分类:其他好文   时间:2015-05-12 11:32:19    阅读次数:89
nyoj 803 A/B Problem(大数除小数&&大数求余小数)
这道题 也就是大数除或者求模小数,不过听说java处理大数很方便,可是java学的一塌糊涂。。有心人用java做吧 奉上c语言代码: #include #include int main() { char a[1000],c[1000],ch; int b,i,j,r; while(scanf("%s %c %d",a,&ch,&b)!=EOF)//a是存贮大数,c...
分类:其他好文   时间:2015-05-12 11:28:18    阅读次数:173
华为机试—元素按奇偶排序
题目: 将数组中偶数从大到小排序,奇数从小到大排序,奇数和偶数交叉着放且输出数组第一位放奇数 若奇数和偶数不等长,则把剩下的直接放到数组中。 #include #include #define len 11 using namespace std; int cmp(const void *p,const void *q) { return *(int *)p-*(int *)q;...
分类:编程语言   时间:2015-05-12 11:26:49    阅读次数:125
算法设计与分析 上机题Mergesort
#include using namespace std;#define N 100int g_array[N]; //存放输入的数字static int count; //存放元素的个数// 初始化函数void Initial(){ cout > count; cout > g_array[i];...
分类:编程语言   时间:2015-05-12 11:16:57    阅读次数:133
【状压DP】旅行商问题
给定一张带权有向图,要求从顶点0出发,经过每个结点恰好一次后再返回0,求边权和的最小值。2#include#includeusing namespace std;#define N 16#define INF 214748364#define M 250int n,m;int v[M>v[i]&1)...
分类:其他好文   时间:2015-05-12 11:15:04    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!