#include <stdio.h>
#define SEC_PER_MIN60
void main()
{
int sec ,min ,left ;
printf("convert seconds to minutes and seconds !\n");
printf("ENTER the number of seconds ( <= 0 to quit ) : \n");
scanf ("%d", &sec);
while (sec > 0 ) {
min = sec /SEC_PER_MIN ;
left = sec %SEC_PER_MIN ;
printf("%d sewconds is %d minutes , %d seconds .\n ", sec ,min ,left);
printf("ENTER the number of seconds ( <= 0 to quit ) : \n");
scanf( "%d", &sec);
}
printf("Done !\n");
}
![](https://img.haomeiwen.com/i14161915/d2b60eb344ef5067.png)
网友评论