【发布时间】:2023-04-03 01:50:01
【问题描述】:
大家好,我是C++自学的初学者。 今天我试着做一个简单的计算器,但调试器不断地向我显示同样的错误。使用单化变量 "X" ;单化变量使用“Z”
代码如下:
#include <iostream>
using namespace std;
int main()
{
float x, z, a;
a = x + z;
cout << "Welcome to the calculator" << endl;
cout << "State the first number " << endl;
cin >> x ;
cout << "State the second number " << endl;
cin >> z ;
cout << "If you wanted to time number" << x << "by this number" << z << "The result would be : " << a << endl;
system("pause");
return 0;
}
【问题讨论】:
-
请不要用“改进”更新问题;它使答案变得毫无意义。 (我已将其回滚。)接受一个有帮助的答案,如果您有任何进一步的问题,请发布另一个问题。 (你应该从this list 给自己买一本书并阅读有关“作业”的内容。)
-
有时少即是多,“大家好”无缘无故地排除了大约一半的社区;)
-
添加到 molbdnilos 评论:如果你想分享你的固定/改进的代码,回答你自己的问题是完全可以的,但你真的不应该修复问题本身的代码
标签: c++ calculator