c语言 syntax error : 'type',求解救syntax error : missing ';' before 'type'

已结贴√

问题点数:10 回复次数:12

ca56232b3bbedf9a539d07f37fffb99a.gif

3144d8b7615c79d9f638db40d5689d26.gif

a218af6549b45ee526caf607ebff1358.gif

0f8df0e29816ae721419de940fb833d1.gif

求解救syntax error : missing ';' before 'type'

在vc++6.0中建立的.c程序

#include

int main()

{

printf("shuru10geshu:");

int i,j,t;

int a[10];

for(i=0;i<10;i++)

scanf("%d",&a[i]);

printf("paixuhou:\n");

for(j=1;j<10;j++)

for(i=j-1;i<10;i++)

if(a[i]>a[j])

{

t=a[i];

a[i]=a[j];

a[j]=t;

};

for(i=0;i<10;i++)

printf("%5d",a[i]);

}

-------------------Configuration: maopaopaixu - Win32 Debug--------------------

Compiling...

maopaopaixu.c

C:\Documents and Settings\Administrator\maopaopaixu.c(5) : error C2143: syntax error : missing ';' before 'type'

C:\Documents and Settings\Administrator\maopaopaixu.c(6) : error C2143: syntax error : missing ';' before 'type'

C:\Documents and Settings\Administrator\maopaopaixu.c(7) : error C2065: 'i' : undeclared identifier

C:\Documents and Settings\Administrator\maopaopaixu.c(8) : error C2065: 'a' : undeclared identifier

C:\Documents and Settings\Administrator\maopaopaixu.c(8) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(8) : error C2102: '&' requires l-value

C:\Documents and Settings\Administrator\maopaopaixu.c(10) : error C2065: 'j' : undeclared identifier

C:\Documents and Settings\Administrator\maopaopaixu.c(12) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(12) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(14) : error C2065: 't' : undeclared identifier

C:\Documents and Settings\Administrator\maopaopaixu.c(14) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(15) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(15) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(15) : error C2106: '=' : left operand must be l-value

C:\Documents and Settings\Administrator\maopaopaixu.c(16) : error C2109: subscript requires array or pointer type

C:\Documents and Settings\Administrator\maopaopaixu.c(16) : error C2106: '=' : left operand must be l-value

C:\Documents and Settings\Administrator\maopaopaixu.c(19) : error C2109: subscript requires array or pointer type

Error executing cl.exe.

maopaopaixu.obj - 17 error(s), 0 warning(s)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值