#include <stdio.h>
int main()
{
float speed, max, x;
scanf("%f %f", &speed, &max);
x = (speed - max) / max * 100; //时速与限速的差值。
if (x >= 50)
printf("Exceed %.0f%%. License Revoked\n", x);
else if (x >= 10)
printf("Exceed %.0f%%. Ticket 200\n", x);
else
printf("OK\n");
return 0;
}
浙大版《C语言程序设计(第3版)》题目集 习题3-2 高速公路超速处罚 (15分)
猜你喜欢
转载自blog.csdn.net/qq_44458489/article/details/105282095
今日推荐
周排行