C Primer Plus5-1
2016-01-08 11:55
399 查看
/*1.编写一个程序。将用分钟表示的时间转换成以小时和分钟表示的时间。使用#define 或者 const 来创建一个代表 60 的符号常量。使用 while 循环来允许用户重复键入值,并且当键入一个小于等于 0 的时 间时终止循环。*/ #include<stdio.h> #include<stdlib.h> #define time 60 int main() { int minute; printf("Please input time:"); scanf("%d", &minute); while(minute > 0) { printf("%d hours %d minutes\n", minute / time, minute % time); printf("Please input time:"); scanf("%d", &minute); } system("pause"); return 0; }
相关文章推荐
- UILabel ,UITextView设置行间距
- Python/C API 异常处理
- tomcat相关参数
- spring注解(转载,自己学习)
- C Primer Plus4-6
- C Primer Plus4-7
- 根据物流号查看物流信息
- maven的坑2
- 正排索引(forward index)与倒排索引(inverted index)
- 指向函数的指针数组
- 搜索引擎-倒排索引基础知识
- 搜索引擎中的倒排索引(inverted index)机制
- 程序员面试问题2:矩阵区域和 Programming Interview Questions 2: Matrix Region Sum
- linux makefile文件管理工程
- Swift数组、字典和集合
- CDI技术第三步,对话作用域
- php实现MVC框架的简单实例
- C Primer Plus4-5
- iOS绘图教程
- 猎豹移动(金山网络)2015校园招聘(c++project师)