gpt4 book ai didi

c++ - 为什么这行不通?第二个功能不会注册?

转载 作者:行者123 更新时间:2023-11-28 07:57:00 25 4
gpt4 key购买 nike

<分区>

#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 : error LNK2001: 未解析的外部符号 _mainCRTStartup1>c:\users\justin\desktop\1.2\Debug\1.2.exe : fatal error LNK1120: 1 Unresolved external ========== 构建:0 成功,1 失败,0 最新,0 跳过 ==========

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com