Programming Language/C
2022.02.04
Solution #define _CRT_SECURE_NO_WARNINGS #include int main(void) { char gender; int age; float height; printf("Enter your gender: "); scanf("%c", &gender); printf("Enter your age: "); scanf("%d", &age); printf("Enter your height: "); scanf("%f", &height); printf("성별\t\t나이\t\t키\n"); printf("%c\t\t%d\t\t%f\n", gender, age, height); } 결과 창
Programming Language/C
2022.02.04
Solution #define _CRT_SECURE_NO_WARNINGS #include int main(void) { int base, height, width; int area, circum; printf("밑변과 높이를 입력하세요: "); scanf("%d %d", &base, &height); area = (base * height) / 2; printf("밑변과 높이가 각각 %d와 %d인 삼각형의 넓이는 %d이다.\n", base, height, area); printf("직사각형의 가로와 높이를 입력하세요: "); scanf("%d %d", &width, &height); circum = (width * 2) + (height * 2); area = width * height; printf("..
Programming Language/C
2022.02.04
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); } 결과 창
Programming Language/C
2022.02.04
Solution #define _CRT_SECURE_NO_WARNINGS #include int main(void) { int totalSecond; int hour, minute, second; printf("Enter the total seconds: "); scanf("%d", &totalSecond); hour = totalSecond / 3600; minute = totalSecond % 3600 / 60; second = totalSecond % 3600 % 60; printf("---Calculation Result---\n"); printf("%d seconds\n", totalSecond); printf("%dh %dm %ds\n", hour, minute, second); } 결과 창