C++ 我的int main(){}有问题

C++ 我的int main(){}有问题,c++,C++,在声明main之前,需要在类定义结尾处使用分号} 否则,它会认为您试图将类定义为main返回类型的一部分,因为两者之间没有分隔符,因此会出现错误消息: 错误:返回类型中可能未定义新类型 当然,它也会抱怨,因为在它丢弃int之后,您也没有从main返回int类型,因为您已经(尽管是无意中)指定了一个返回类型: 错误:忽略无关的“int” 错误:“main”必须返回“int” 错误:“main”的返回类型更改为intThnaks,原因是:它对代码进行了排序。请花时间正确缩进代码。-1:对于低质量的代

在声明main之前,需要在类定义结尾处使用分号}

否则,它会认为您试图将类定义为main返回类型的一部分,因为两者之间没有分隔符,因此会出现错误消息:

错误:返回类型中可能未定义新类型

当然,它也会抱怨,因为在它丢弃int之后,您也没有从main返回int类型,因为您已经(尽管是无意中)指定了一个返回类型:

错误:忽略无关的“int” 错误:“main”必须返回“int”
错误:“main”的返回类型更改为int

Thnaks,原因是:它对代码进行了排序。请花时间正确缩进代码。-1:对于低质量的代码,请调试我的代码问题。
#include <iostream>

using namespace std;

char sell;
int crew;
char you [50];
int ships =1;
int money;
int choice;

class ship{
public:
void sell_shii(){
cout<<"Do you wish to seel your ship?"<<endl;
cout<<"1to sell ship and 2to cancel"<<endl;


cin>>sell;
if (sell==1 && ships >0){
cout<<"You sold your ship"<<endl;
ships+=sell;



}else{
cout<<"You didnt sell your ship"<<endl;
}
}
}





int main()
{



cout<<"What is your name captain?"<<endl;
cin>>you;
cout<<"Welcome captain "<<you<<endl;

cout<<"You have "<<ships<<"ship/s";

cout<<"What would you like to do?\n 1 buy ships 2 sell ships\n 3 battle\n
cin<<choice;

switch (choice)

case 1:
buyship()
break;
case 2:
sellshii()
break;
case 3;
battle();

return 0;

}
C:\Users\Ethan\Desktop\New folder.IPA\C++\Ship game\main.cpp|37|error: new types may not be defined in a return type|
C:\Users\Ethan\Desktop\New folder.IPA\C++\Ship game\main.cpp|37|error: extraneous `int' ignored|
C:\Users\Ethan\Desktop\New folder.IPA\C++\Ship game\main.cpp|37|error: `main' must return `int'|
C:\Users\Ethan\Desktop\New folder.IPA\C++\Ship game\main.cpp|37|error: return type for `main' change to "int"