From a3555612b6814bdfce0cbc6110891e61252d3980 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 19 Jan 2017 17:29:49 -0500 Subject: Show one digit of each hour in clock --- .bin/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.bin') diff --git a/.bin/clock.c b/.bin/clock.c index 9eb4dc23..69d33dae 100755 --- a/.bin/clock.c +++ b/.bin/clock.c @@ -18,7 +18,7 @@ int main() { case 0: printf("...%02d...\n", clock->tm_hour); break; case 1: printf("..%02d....\n", clock->tm_hour); break; case 2: printf(".%02d.....\n", clock->tm_hour); break; - case 3: printf("%02d....%02d\n", clock->tm_hour, clock->tm_hour + 1); break; + case 3: printf("%d......%d\n", clock->tm_hour % 10, (clock->tm_hour + 1) / 10); break; case 4: printf(".....%02d.\n", clock->tm_hour + 1); break; case 5: printf("....%02d..\n", clock->tm_hour + 1); break; case 6: printf("...%02d...\n", clock->tm_hour + 1); break; -- cgit 1.4.1