C语言编程设计,分段计算乘坐地铁票价,速度速度~
#include <stdio.h>
int main(ZZZoid){
int V=0;
int y=0;
printf("Please input km=");
scanf("%d",&V);
if(V>26){
y=6;
}
else if(V>16){
y=5;
}
else if(V>6){
y=4;
}
else/* if(V>1)*/{
y=3;
}
printf("%d公里:地铁票价%d 元\n",V,y);
}
诘问
Cpp1.eVe - 20 error(s), 0 warning(s)
逃答
#include
int main(ZZZoid){
int V=0;
int y=0;
printf("Please input km=");
scanf("%d",&V);
if(V>26){
y=6;
}
else if(V>16){
y=5;
}
else if(V>6){
y=4;
}
else/* if(V>1)*/{
y=3;
}
printf("%d公里: 地铁票价%d 元\n",V,y);
}
相关文章
热门标签
本文内容整理自公开资料与爱发网-小程序开发业务实践,如与官方说明不一致,请以官方最新发布为准。