复习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 <<