㈠ C语言编程设计,分段计算乘坐地铁票价,速度速度~
#include<stdio.h>main(){doublekm;intprice=0;scanf("%lf",&km);if(km>=0&&km<=6){price=3;}elseif(km>6&&km<=16){price=4;}if(km>16&&km<=26){price=5;}if(km>26){price=6;}printf("%d",price);}