在vs2010编译程序时出现“语法错误 : 缺少";"(在"类型"的前面)”是什么原因?
#includeintmain(){inta[729];inti,i1,i2,i3=0;for(i=1;i<=9;i++){for(i1=1;i1<=9;i1++){fo...
#include
int main ()
{
int a[729];
int i,i1,i2,i3=0;
for(i=1;i<=9;i++)
{
for(i1=1;i1<=9;i1++)
{
for(i2=1;i2<=9;i2++,i3++)
a[i3]=i*100+i1*10+i2;
}
}
for(i=0;i<729;i++)
{
printf("%4d",a[i]);
if(i%10==0)
printf("\n");
}
int temp,temp1,temp2;
for(i=0;i<729;i++)
{temp=a[i];
for(i1=0;i1<729;i1++)
{temp1=a[i1];
for(i2=0;i2<729;i2++)
{
temp2=a[i2];
if(temp2*2/3==temp1 && temp1/2 == temp)
printf("%d %d %d\n",temp2,temp1,temp);
}
}
}
return 0;
}
错误 1 error C2143: 语法错误 : 缺少“;”(在“类型”的前面) c:\users\daiqiang\documents\visual studio 2010\projects\threekills.c\threekills.c\threekills.c 24 1 threekills.c 展开
int main ()
{
int a[729];
int i,i1,i2,i3=0;
for(i=1;i<=9;i++)
{
for(i1=1;i1<=9;i1++)
{
for(i2=1;i2<=9;i2++,i3++)
a[i3]=i*100+i1*10+i2;
}
}
for(i=0;i<729;i++)
{
printf("%4d",a[i]);
if(i%10==0)
printf("\n");
}
int temp,temp1,temp2;
for(i=0;i<729;i++)
{temp=a[i];
for(i1=0;i1<729;i1++)
{temp1=a[i1];
for(i2=0;i2<729;i2++)
{
temp2=a[i2];
if(temp2*2/3==temp1 && temp1/2 == temp)
printf("%d %d %d\n",temp2,temp1,temp);
}
}
}
return 0;
}
错误 1 error C2143: 语法错误 : 缺少“;”(在“类型”的前面) c:\users\daiqiang\documents\visual studio 2010\projects\threekills.c\threekills.c\threekills.c 24 1 threekills.c 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询