#include <iostream.h>
int main()
{
double displayed_value;
double new_entry;
char command_character;
displayed_value = 0.0;
cout << "计算器演示程序" << endl;
cout<< "----" << endl;
cout << "在'>' 提示后输入一个命令字符"
<< endl;
cout << "Value : " << displayed_value << endl;
cout << "command>";
cin >> command_character;
while (command_character != 'Q') {
switch(command_character) {
case 'C':
displayed_value = 0.0;
break;
case '+':
cout << "number>";
cin >> new_entry;
displayed_value += new_entry;
break;
case '-':
cout << "number>";
cin >> new_entry;
displayed_value -= new_entry;
break;
case '*':
cout << "number>";
cin >> new_entry;
displayed_value *= new_entry;
break;
case '/':
cout << "number>";
cin >> new_entry;
displayed_value /= new_entry;
break;
default:
cout << "不可理解的输入!";
cin.ignore(100,'\n');
} //End of switch
cout << "Value : " << displayed_value << endl;
cout << "command>";
cin >> command_character;
} //End of while
return 0;
}
就是这个程序
出现上面的错误 我实在不知道是哪里错拉
这是一个简单的计算器的程序