为什么执行程序出错?
#include <stdio.h>
int main()
int year = 2014;
{
if((year%4==0&&year%100!=0)||year%400==0)
{
printf("%s\n","今年是闰年");
}
else
{
printf("%s\n","今年是平年");
}
return 0;
}
Compiling...
四月五号.c
F:\教程\VC6.0精简版[支持C、C++]\vc6精简版[中文版]\Microsoft Visual Studio\MyProjects\四月五号\四月五号.c(3) : error C2085: 'year' : not in formal parameter list
F:\教程\VC6.0精简版[支持C、C++]\vc6精简版[中文版]\Microsoft Visual Studio\MyProjects\四月五号\四月五号.c(3) : error C2143: syntax error : missing ';' before '='
F:\教程\VC6.0精简版[支持C、C++]\vc6精简版[中文版]\Microsoft Visual Studio\MyProjects\四月五号\四月五号.c(4) : error C2449: found '{' at file scope (missing function header?)
F:\教程\VC6.0精简版[支持C、C++]\vc6精简版[中文版]\Microsoft Visual Studio\MyProjects\四月五号\四月五号.c(14) : error C2059: syntax error : '}'
执行 cl.exe 时出错.
四月五号.exe - 1 error(s), 0 warning(s)
请问哪里出错?