Solution #define _CRT_SECURE_NO_WARNINGS #include int main(void) { int h, m, s; int totalSecond; printf("Enter h m s: "); scanf("%d %d %d", &h, &m, &s); totalSecond = h * 3600 + m * 60 + s; printf("---Calculation Result---\n"); printf("Total %d seconds\n",totalSecond); } 결과 창
Solution #define _CRT_SECURE_NO_WARNINGS #include int main(void) { int score1, score2; int average; printf("Enter two scores: "); scanf("%d %d", &score1, &score2); average = (score1 + score2) / 2; printf("The average is %d.\n", average); } 결과 창