1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define SEC_PER_HOUR 3600 // 1½Ã°£Àº 3600ÃÊ #define SEC_PER_MINUTE 60 // 1ºÐÀº 60ÃÊ int main(void) { int input, hour, minute, second; printf("ÃÊ´ÜÀ§ÀÇ ½Ã°£À» ÀÔ·ÂÇϽÿä:(32¾ïÃÊÀÌÇÏ) "); scanf("%d", &input); // ÃÊ´ÜÀ§ÀÇ ½Ã°£À» Àд´Ù. hour = input / SEC_PER_HOUR; // ¸î ½Ã°£ minute = (input % SEC_PER_HOUR) / SEC_PER_MINUTE; // ¸î ºÐ second = input % SEC_PER_MINUTE; // ¸î ÃÊ printf("%dÃÊ´Â %d½Ã°£ %dºÐ %dÃÊÀÔ´Ï´Ù. \n", input, hour, minute, second); return 0; } | cs |