#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double a;
double b;
a =(3.0);
b =(5.0);
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << fixed << setprecision (1) << b << "\n" << endl;
cout << "------" << endl;
cout << fixed << setprecision (2) << a*b << "\n" << endl;
system("PAUSE");
return 0;
}
int calculate ()
{
double a;
double b;
double c;
a = (7.1);
b = (8.3);
c = (2.2);
cout << fixed << setprecision(1) << endl;
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << fixed << setprecision (1) << b << "\n" << endl;
cout << "- " << fixed << setprecision (1) << c << "\n" << endl;
cout << "------" << endl;
cout << std::setprecision(2) << (a * b) - c << "\n" << std::endl;
system("PAUSE");
return 0;
}
请不要只是告诉我阅读介绍性 C++ 书籍或以模糊的方式告诉我我的问题,我有 1,它遗漏了像这样的非常小的细节。可悲的是,我一直在努力让它工作一个小时,哈哈。
输出:
1>----- 构建开始:项目:1.2,配置:调试 Win32 ------ 1>LINK:错误 LNK2001:无法解析的外部符号 _mainCRTStartup 1>c:\users\justin\desktop\1.2\Debug \1.2.exe:致命错误LNK1120:1个未解决的外部==========构建:0成功,1失败,0最新,0跳过==========