输入分钟数,按小时和分钟输出

/*****************************************************
copyright (C), 2014-2015, Lighting Studio. Co.,     Ltd.
File name:
Author:Jerey_Jobs    Version:0.1    Date:
Description:
Funcion List:
*****************************************************/

#include
#define MIN_PER_HOUR 60

int fun(int min);

int main()
{
    int min;
 printf("Enter the minutes:");
 scanf("%d",&min);
 fun(min);
    return 0;
}

int fun(int min)
{
 int hour,mins;
 hour = min / MIN_PER_HOUR;
 mins = min % MIN_PER_HOUR;
 printf("%d minutes is %d hours %d mins\n",min,hour,mins);
}

你可能感兴趣的:(输入分钟数,按小时和分钟输出)