#include <stdio.h>

int main() {
    double distance_km;
    double speed = 3.0;
    double distance_m;
    double time_sec;
    double time_min;
    int minutes, seconds;
    int total_sec;

    printf("이동거리를 km 단위로 입력하세요: ");
    scanf("%lf", &distance_km);

    distance_m = distance_km * 1000.0;
    time_sec = distance_m / speed;
    time_min = time_sec / 60.0;

    printf("%.3f분\n", time_min);

    total_sec = (int)time_sec;
    minutes = total_sec / 60;
    seconds = total_sec % 60;
    printf("%d분 %d초\n", minutes, seconds);

}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: