我试图做一个关于打印与他们的长度的顶部和底部边缘的梯形程序。但我无法执行我的代码来查看它是否正常工作。这里是我的代码:错误C2449和错误C2059
#include <stdio.h>
int main(void);
{
int top, bot, a, b;
printf("Please enter the length of top:");
scanf("%d", &top);
printf("Please enter the length of bottom:");
scanf("%d", &bot);
for(a = top; a < bot; a++) {
for(b = top; b < a+1; b++) {
printf("* ");}
printf("\n");}
return 0;
}
这里是我的错误文本: 错误C2059:语法错误: '}'
错误C2449:(?缺少函数头)发现 '{' 在文件范围内