为了账号安全,请及时绑定邮箱和手机立即绑定

为什么修改了变量的类型,程序就运行不了;我把num和add的类型改为char,就得不到想要的结果

为什么修改了变量的类型,程序就运行不了;我把num和add的类型改为char,就得不到想要的结果

C++
慕田峪3750655 2016-07-22 11:33:21
#include <iostream>int main(){ using namespace std; double num = 0; double add = 0; cout << "input the number: "; cin >> num; while (num!=0) { add += num; cout << "input the number again: "; cin >> num; } cout << "the total of these number is " << add << endl; return 0;}
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 1149 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号