卡式炉气罐可以充气吗:c语言公路收费系统的设计的源码

来源:百度文库 编辑:高校问答 时间:2024/05/01 22:02:28

http://topic.csdn.net/t/20030111/11/1348644.html
给你这个网站,基本上可以得到你想要的拉

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
char cx;
int x, a;
double y;
printf("输入你的车车型为你车的第一个字母:");
scanf("%c",&cx);
do
{
if (cx=='c'||cx=='b'||cx=='t')
continue;
else
printf("你所输入的不对,请从新输入");
scanf("%c",&cx);
}while(!(cx=='c'||cx=='b'||cx=='t'));
printf("请输入你所行驶的路程");
scanf("%d",&x);
if(cx=='c')
y = 0.50 * x;
else if(cx=='b')
y = 1.50 * x;
else
y = 1.00 * x;
printf("你应该交费%f\n", y);
return 0;
}
我用VS编的,你适当改一下前面就可以用。。。。