Dev编译器中,cpp编译提示[Error] '::main' must return 'int'解决办法以及原因

复习c的时候,用devcpp总是提示error,内容是[Error] '::main' must return 'int'
代码如下:

#include<iostream>
using namespace std;
const size_t maxsize = 11;
void main()
{
	char Array_text[maxsize];
	cout << "请按序号顺序输入二叉树的结点:" << endl;
	for (size_t i = 1; i < maxsize; i++)
	{
		std::cin >> Array_text[i];
	}
	char aim_search;
		int index = 0;
	bool search_flag = false;
	cout << "请输入要查找的结点:" << endl;
	std::cin >> aim_search;
	for (size_t j = 1; j < maxsize; ++j)
	{
		if (aim_search == Array_text[j])
		{
			index = j;
			search_flag = true;
			break;
		}
	}
if (!search_flag)
{
	cout << "非此树中的结点:"<<endl;
}
else
{
	size_t father = index / 2, lson = 2 * index, rson = 2 * index + 1;
	if (father < 1)
	{
		printf("无父节点\n");
	}
	else
	{
		std::cout << 
  • 12
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值