#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;}
為什么修改了變量的類型,程序就運(yùn)行不了;我把num和add的類型改為char,就得不到想要的結(jié)果
慕田峪3750655
2016-07-22 11:33:21