#include <iostream>
#include <iomanip>
using namespace std;
int main () // print to console: 3.0*5.0=15.00
{
double a;
double b;
a =(3.0);
b =(5.0);
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << b << "\n" << endl;
cout << "------" << endl;
cout << fixed << setprecision (2) << a*b << "\n" << endl;
return 0;
}
int calculate () // print to console: (7.1*8.3)-2.2=56.73
{
double a;
double b;
double c;
a = (7.1);
b = (8.3);
c = (2.2);
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << b << "\n" << endl;
cout << "- " << c << "\n" << endl;
cout << "------" << endl;
cout << setprecision(2) << (a*b)-c << "\n" << endl;
return (a*b)-c;
}
int calculation () // print to console: 3.2/(6.1*5.0)=0.10
{
double a;
double b;
double c;
a=(3.2);
b=(6.1);
c=(5.0);
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << b << "*" << c << endl;
cout << "------" << endl;
cout << setprecision(2) << a/(b*c) << "\n" << endl;
system("PAUSE");
return a/(b*c);
}
我从来没有遇到过这个错误。我是 C++ 新手,所以一些方向会很棒!如何更改此代码以使其在不闪烁的情况下打印。谢谢!
输出:1>LINK:错误 LNK2001:无法解析的外部符号 _mainCRTStartup 1>致命错误 LNK1120:1 无法解析的外部符号