- 11
- 0
- 约3.6万字
- 约 43页
- 2018-03-07 发布于河南
- 举报
C上机指导答案
实验答案
实验一
(略)
实验二
1、
2、
3、
(1)
#include iostream //包含头文件命令
using namespace std; //使用名字空间std
int main()
{ int a,b,c; //定义两个变量a和b
coutPlease input to a, b and c: endl; //输出提示信息到屏幕
cinabc; //等待用户从键盘输入数据
int max(int x, int y)?; //有两个形参的max函数原型声明
cout Max(a,b)= max(a,b)endl; //输出结果信息至屏幕
int max(int x, int y, int z)?; //有三个形参的max函数原型声明
cout Max(a,b,c)= max(a,b,c)endl; //输出结果信息至屏幕
return 0; //主函数返回0至操作系统
}
int max(int x, int y) { return (x y)??x:y; } //求两个数中的大者的函数
int max(int x, int y, int z) //求三个数中的大
原创力文档

文档评论(0)