求解救syntax error : missing ';' before 'type'
在vc++6.0中建立的.c程序#include<stdio.h>
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)