#include <stdio.h>
int main(void){
const trans=60;
int time=0;
int hour;
int minutes;
puts("Enter your time cal in minutes:");
scanf("%d",&time);
while(time>0){
hour=time/trans;
minutes=time-trans*hour;
printf("The time is %d hours and %d minutes.\n",hour,minutes);
puts("Enter your time cal in minutes:");
scanf("%d",&time);
}
int main(void){
const trans=60;
int time=0;
int hour;
int minutes;
puts("Enter your time cal in minutes:");
scanf("%d",&time);
while(time>0){
hour=time/trans;
minutes=time-trans*hour;
printf("The time is %d hours and %d minutes.\n",hour,minutes);
puts("Enter your time cal in minutes:");
scanf("%d",&time);
}
}
本文转sinojelly51CTO博客,原文链接:http://blog.51cto.com/pnig0s1992/411897,如需转载请自行联系原作者