實驗3-10 高速公路超速處罰 (15 分)
按照規定,在高速公路上行使的機動車,達到或超出本車道限速的10%則處200元罰款;若達到或超出50%,就要吊銷駕駛證。請編寫程式根據車速和限速自動判别對該機動車的處理。
輸入格式:
輸出格式:
輸入樣例1:
65 60
輸出樣例1:
OK
輸入樣例2:
110 100
輸出樣例2:
Exceed 10%. Ticket 200
輸入樣例3:
200 120
輸出樣例3:
Exceed 67%. License Revoked
#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
double t;
t=(a-b)*100.0/b;
if(t>=10&&t<50){
printf("Exceed %.0lf%%. Ticket 200",t);
}else if(t>=50){
printf("Exceed %.0lf%%. License Revoked",t);
}else{
printf("OK");
}
return 0;
}