摘要: # include # include # include using namespace std;struct twodim{ int r; int c; float *a;};struct twodim s;bool init_twodim(twodim&s, i... 阅读全文
posted @ 2019-03-16 12:23 198FOR 阅读(133) 评论(0) 推荐(0) 编辑
摘要: # include # include using namespace std;const int M = 10000005;struct three{ double w; //每个宝物的重量 double v; //每个宝物的价值 double p; //性价... 阅读全文
posted @ 2019-03-15 23:28 198FOR 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 用一维数组存储古董的重量:# include # include using namespace std;const int N = 100005;double w[N];int main()输入数据double c; int n; //载重量c和古... 阅读全文
posted @ 2019-03-14 21:24 198FOR 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 演示new和delete的基本用法# includeusing namespace std;int main(){ int * p; p = new int; *p = 25; //也可在内存分配时,为其准备初值,如:p = new int(25) co... 阅读全文
posted @ 2019-03-14 17:02 198FOR 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 内联函数是使用关键字inline关键字声明的函数重载函数通常用来对具有相似行为而数据类型或数据个数不同的操作提供一个通用的名称实例:# include using namespace std;inline void print(int a) //内联函... 阅读全文
posted @ 2019-03-14 16:52 198FOR 阅读(93) 评论(0) 推荐(0) 编辑