C primer plus 第九章 练习1:
2016-05-28 22:04
225 查看
/*************************************************/ /* 设计函数min(x,y), 返回两个double数值中较小 */ /* 的数值,同时用一个简单的驱动程序测试该函数。 */ /*************************************************/ #include <stdio.h> int min(int x, int y); int main(void) { int x, y; printf("Please input tow integer(q to quit): \n"); while (scanf_s("%d %d", &x, &y) == 2) { if (x == y) printf("%d and %d are sam.\n\n", x, y); else printf("%d and %d min is %d\n\n", x, y, min(x, y)); printf("Please input tow integer(q to quit): \n"); } return 0; } int min(int x, int y) { if (x > y) return y; else if (x < y) return x; }
相关文章推荐
- java怎么去除字符串中的数字
- 十天冲刺开发第十个人工作总结
- Bean在Spring容器中经历的阶段
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5705
- 如何设计一个数据字典
- 剑指offer(三十七)之从上往下打印二叉树
- Hive2.0.0操作HBase 1.2.1报错解决
- 个人工作总结05(第二阶段)
- Eclipse的PyDev插件安装及解决安装后找不到的问题
- ssh学习之旅(3)--himbernate-bug记录-"not-null property references a null or transient value"
- Android实现Service下载文件,Notification显示下载进度
- 实习入职第八天:小知识点汇总
- 学习进度条 第十三周
- list容器
- 实参和形参都是指针。。
- 嵌入式linux C语言(一)——位运算的使用
- Android后台云端服务Bmob导入大坑
- java多线程---线程的创建方式
- 图像的高斯滤波
- [笔记]RHEL6.4使用本地ISO镜像做yum源