用C语言编程要用else-if 语句和 switch 语句

2024-11-24 04:38:04
推荐回答(2个)
回答1:

#include 察孙
void main() 
{
int speed,limit;
scanf("%d%d",&speed,&limit);
if(speed<=limit*(1+0.1)) 
printf("OK"滚没颤);
else if(speed<=limit*(1+0.5)) 
printf("大败Exceed %d%% Ticket 200.",(int)(speed*100/limit-100));
else printf("Exceed %d%% License Revoked.",(int)(speed*100/limit-100));
}

回答2:

100 80
(100-80)/拆派改旅判羡斗100=0.2~20%
~~~~~~
~~~~~~~~~~
~
~~~~~~~~~~~~~