不明白,为什么?

earphone 2002-07-07 06:28:17
while ( gallons != -1 ){
cout << "Enter the gallons used (-1 to end): ";
cin >> gallons;

if ( gallons == -1 )
break;

cout << "Enter the miles driven: ";
cin >> gallons;

cout << "The miles / gallon for this tank was "
<< miles/gallons << endl;
gallons_tatol += gallons;
miles_tatol += miles;
}
不能输入第二个数值。
...全文
15 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
johnmack 2002-07-08
  • 打赏
  • 举报
回复
没什么问题呀
cxjddd 2002-07-07
  • 打赏
  • 举报
回复
好象没有什么问题啊。
earphone 2002-07-07
  • 打赏
  • 举报
回复
我用BCW5。0
就是不行,为什么?
cft007 2002-07-07
  • 打赏
  • 举报
回复
你的编译器有问题
casho 2002-07-07
  • 打赏
  • 举报
回复
我在vc下面通过呀,
# include <iostream.h>
void main()
{
int gallons=0,miles_tatol=0,gallons_tatol=0,miles=0;
while ( gallons != -1 ){
cout << "Enter the gallons used (-1 to end): ";
cin >> gallons;

if ( gallons == -1 )
break;

cout << "Enter the miles driven: ";
cin >> miles;

cout << "The miles / gallon for this tank was "
<< miles/gallons << endl;
gallons_tatol += gallons;
miles_tatol += miles;
}
}
sop 2002-07-07
  • 打赏
  • 举报
回复
compiler的问题。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧