摘要: 【例1:用指针指向两个变量,通过指针运算选出值小的那个数】 #include <stdio.h> int main(void) { int a,b,min,*pmin,*pa,*pb; pmin=min; pa=&a; pb=&b; scanf("%d %d\n",pa,pb);//输入的值依次存放 阅读全文
posted @ 2020-08-08 09:51 橘子大侠 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 这是问题: 解: 单位换算:1‘06’8=66.8秒 重点:记Cij为队员i泳姿为j的成绩;i=1,2,3,4,5;j=1,2,3,4;Xij=1即队员i参加泳姿j的比赛; ①.lingo代码 Min=66.8*x11+75.6*x12+87*x13+58.6*x14+57.2*x21+66*x22 阅读全文
posted @ 2020-04-20 17:46 橘子大侠 阅读(1706) 评论(0) 推荐(0) 编辑
摘要: 线性规划模型 ①Lingo代码 min=12*x_11+24*x_12+8*x_13+30*x_21+12*x_22+24*x_23;[st_1] x_11+x_12+x_13=4;[st_2] x_21+x_22+x_23=8;[st_3] x_11+x_21>2;[st_4] x_12+x_22 阅读全文
posted @ 2020-04-07 23:40 橘子大侠 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 目标函数:max=72*x+64*y; 约束条件: 原料:x+y<=50; 劳动时间:12*x+8*y<=480; 加工能力: 3*x<=100; 非负约束:x>=0,y>=0; ①Lingo代码: max=72*x+64*y;[st_1] x+y<50;[st_2] 12*x+8*y<480;[s 阅读全文
posted @ 2020-03-30 11:57 橘子大侠 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 小白来啦!今天要写一个简单的完整的项目! 内容:输入整数, 输出复数 第一个文件,名为f1_const.h 符号声明文件 //第一个文件,文件命名为f1_const.h 是个符号声明文件(基本每次作业都需要) const int TRUE = 1;//相当于#defiine TRUE 1 const 阅读全文
posted @ 2020-03-29 21:52 橘子大侠 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 小白又来啦!今天是多文件操作! 我们从最开始学习用Dev C++这个软件时,是直接创建的源代码文件,随着学习的深入,我们有时候需要写的东西越来越多,有时候其实都写在一个源代码文件里面很不方便,于是我们开始用“项目”,将多个源代码文件放在一个类似“文件夹”的里面,编译的时候会自动将这个项目里面的文件链 阅读全文
posted @ 2020-03-29 14:49 橘子大侠 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 计算阶乘(键盘敲入) 第一种调用函数fact #include <cstdio> #include <iostream> using namespace std; //函数定义不能掉 int fact(int)//函数名为fact inr main() { int i=5; cout<<fact(i 阅读全文
posted @ 2020-03-24 23:37 橘子大侠 阅读(143) 评论(0) 推荐(0) 编辑
摘要: ①有确定数据和个数 #include<cstdio>//c++中用的,在这里也可以用 #include<iostream>//c++库文件。指输入(in)输出(out)流(stream) using namespace std;//C++语法 int main() { int a[10],i; fo 阅读全文
posted @ 2020-03-23 17:28 橘子大侠 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio>//c++中用的,在这里也可以用 #include<iostream>//c++库文件。指输入(in)输出(out)流(stream) using namespace std;//C++语法 //当碰到有一种数据类型有多个成分,并且各个成分的数据类型不一定相同时我们需 阅读全文
posted @ 2020-03-23 16:52 橘子大侠 阅读(105) 评论(0) 推荐(0) 编辑
摘要: //#include<stdio.h>是C语言库文件:基本(std)输入(i)输出(o)文件 #include<cstdio>//c++中用的,在这里也可以用 #include<iostream>//c++库文件。指输入(in)输出(out)流(stream) using namespace std 阅读全文
posted @ 2020-03-23 16:22 橘子大侠 阅读(113) 评论(0) 推荐(0) 编辑