C语言地铁票价计算程序
#include<stdio.h>
int main() { int num, station, fee; printf('请输入人数:'); scanf('%d',&num); printf('请输入站数:'); scanf('%d',&station); if(station>=1 && station<=4) { fee = 3num; } else if(station>=5 && station<=9) { fee = 4num; } else if(station>9) { fee = 5*num; } printf('应付款为:%d元\n',fee); return 0; }
原文地址: https://www.cveoy.top/t/topic/np6d 著作权归作者所有。请勿转载和采集!