URI ONLINE JUDGE SOLUTION 1019 - Time Conversion
Problem
#include<stdio.h>
int main()
{
int N, a[3];
scanf("%d", &N);
a[0] = N/3600;
N = N%3600;
a[1] = N/60;
a[2] = N%60;
printf("%d:%d:%d\n", a[0], a[1], a[2]);
return 0;
}
Read an integer value, which is the duration in
seconds of a certain event in a factory, and inform it expressed in
hours:minutes:seconds.
Input
The input file contains an integer N.
Output
Print the read time in the input file (seconds)
converted in hours:minutes:seconds like the following example.
Solution#include<stdio.h>
int main()
{
int N, a[3];
scanf("%d", &N);
a[0] = N/3600;
N = N%3600;
a[1] = N/60;
a[2] = N%60;
printf("%d:%d:%d\n", a[0], a[1], a[2]);
return 0;
}
Comments
Post a Comment