码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
【裸最小生成树】 模板 poj 1258
#include#include#include#include#define MAX 102void read();using namespace std;int map[MAX][MAX],best[MAX],n;bool visit[MAX];int main(){ //freopen(...
分类:其他好文   时间:2014-10-10 12:47:34    阅读次数:172
【dp 背包变形】 poj 1837
#include #include #includeusing namespace std;int dp[21][15001]; //状态数组dp[i][j]int main(int i,int j,int k){ int n; //挂钩数 int g; //钩码数 int c[21]; //...
分类:其他好文   时间:2014-10-10 11:57:04    阅读次数:136
【素数】 poj 2739 一个数能有多少种连续素数相加方案
简单题 素数打表根据数据量用n2算法遍历开一个save【k】素数存前k个素数和即可。#include #include #include #include using namespace std;const int maxn=10002;int pri[maxn+1];int save[2000+1...
分类:其他好文   时间:2014-10-10 11:43:44    阅读次数:195
C++静态代码分析工具对比cppCheck与PreFast
具体内容参看文件《CppCheck和PreFast对Cplusplus代码静态分析测试.zip》C++测试源代码main.cpp#define NULL 0#include #include // 没有初始化void defect1(){ int a; int b; b = a;}// 空指针取值v...
分类:编程语言   时间:2014-10-10 11:28:04    阅读次数:277
UVa 11743 - Credit Check
题目:判断卡号是否合法,给你4组4位的数字,偶数位的2倍的位和加上奇数位的和,判断尾数是否为0。 分析:简单题,模拟。直接按照提议判断即可。 说明:460题,加油! #include #include using namespace std; char data[4][5]; int main() { int n; while (cin >> n) for (int i =...
分类:其他好文   时间:2014-10-10 10:49:34    阅读次数:235
【学生成绩管理系统】 大二c语言作业
几年前写的了,只能在命令行窗口运行,虽然比较挫,还是有一定参考价值...#include #include #include #include #include #include #include #include #define N 5const int maxn = 1002;using nam...
分类:编程语言   时间:2014-10-10 10:19:24    阅读次数:332
4-2电子时钟中的运算符重载
4-2 电子时钟中的运算符重载 Time Limit: 1000MS Memory limit: 65536K 题目描述 通过本题目的练习可以运算符重载的方法; 设计一个时间类Time,私有数据成员有hour(时)、minute(分)、second(秒); 公有成员函数有:setHour(int)设置数据成员hour的值,非法的输入默认为12;setMinue(int...
分类:其他好文   时间:2014-10-10 10:15:14    阅读次数:286
const修饰指针
关于const修饰指针的情况,一般分为如下4种情况:int b =500;const int *a =&b; //情况1int const *a =&b; //情况2int* const a =&b; //情况3const int* const a =&b; //情况4如何...
分类:其他好文   时间:2014-10-10 09:59:24    阅读次数:157
poj 1579 Function Run Fun
题目链接:http://poj.org/problem?id=1579思路: 题目给出递归公式,使用动态规划的记忆搜索即可解决。代码:#include #include const int MAX_N = 20 + 5;int dp[MAX_N][MAX_N][MAX_N];int w( in...
分类:其他好文   时间:2014-10-10 03:37:53    阅读次数:189
const、变量与指针
代码: #include?<stdlib.h> int?main(void)?{ int?arr1[]?=?{?1,?3,?5,?7,?9,?}; const?int?arr2[]?=?{?2,?4,?6,?8,?10,?}; //?普通的指针 int?*?p1?=?arr1; //?可以改变指...
分类:其他好文   时间:2014-10-10 03:11:44    阅读次数:199
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!