https://www.acmicpc.net/problem/6763
6763번: Speed fines are not fine!
Many communities now have “radar” signs that tell drivers what their speed is, in the hope that they will slow down. You will output a message for a “radar” sign. The message will display information to a driver based on his/her speed according to
www.acmicpc.net
코드 :
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
b -= a;
if(b <= 0){
cout << "Congratulations, you are within the speed limit!\n";
}else if(b >= 1 && b <= 20){
cout << "You are speeding and your fine is $100.\n";
}else if(b >= 21 && b <= 30){
cout << "You are speeding and your fine is $270.\n";
}else{
cout << "You are speeding and your fine is $500.\n";
}
}
'PS_Baekjoon' 카테고리의 다른 글
[백준 C++] 6840번 : Who is in the middle? (0) | 2023.05.01 |
---|---|
[백준 C++] 7595번 : Triangles (1) | 2023.04.29 |
[백준 C++] 6749번 : Next in line (1) | 2023.04.27 |
[백준 C++] 5717번 : 상근이의 친구들 (0) | 2023.04.26 |
[백준 C++] 4470번 : 줄번호 (0) | 2023.04.25 |