6763

#include <stdio.h>

int main(void){
    int limit_speed, car_speed;

    // 제한 속도, 차 속도 입력 받기
    scanf("%d", &limit_speed);
    scanf("%d", &car_speed);

    // 속도 구하기
    int speed = car_speed-limit_speed;

    // 출력
    if(speed < 1){
        printf("Congratulations, you are within the speed limit!");
    }
    else if(speed < 21){
        printf("You are speeding and your fine is $100.");
    }
    else if(speed < 31){
        printf("You are speeding and your fine is $270.");
    }
    else {
        printf("You are speeding and your fine is $500.");
    }
    return 0;
}

+ Recent posts