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;
}

'백준' 카테고리의 다른 글
| [ 백준 / C ] 7287번 : 등록 (1) | 2025.08.28 |
|---|---|
| [ 백준 / C ] 31821번 : 학식 사주기 (0) | 2025.08.26 |
| [ 백준 / C ] 15962번 : 새로운 시작 (0) | 2025.08.22 |
| [ 백준 / C ] 4999번 : 아! (0) | 2025.08.21 |
| [ 백준 / C ] 2750번 : 수 정렬하기 (0) | 2025.08.20 |