unexpected token '{' following declaration of 'main' 疯了
程序代码:#include<iostream>
#define M 21
using namespace std;
int max(int a,int b)
{
return a>b ? a:b;
}
int main
{
int n,m,i,j,k;
int a[M][M];
int c[M][M];
while(cin>>n>>m)
{
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
cin>>a[i][j];
for(i=1;i<=n;i++)
c[1][i]=a[1][i];
for(i=2;i<=m;i++)
for(j=1;j<=n;j++)
for(k=1;k<=j;k++)
if(c[i-1][k]+a[i][j-k]>c[i][j])
c[i][j]=c[i-1][k]+a[i][j-k];
int result=c[1][1];
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
result=max(result,c[i][j]);
cout<<result<<endl;
}
}
怎么error C2239: unexpected token '{' following declaration of 'main'实在没办法,哪位大侠帮我看看?









