总结:不可以在for循环初始化中定义变量;
#include<stdio.h>
int main()
{
int a[3];
int temp=0,i,x,y;
for(i=0;i<3;i++) scanf("%d",&a[i]);
/*冒泡排序*/
for(x=0;x<3;x++)
{
for(y=x+1;y<3;y++)
{
if(a[x]<a[y])
{
temp=a[x];
a[x]=a[y];
a[y]=temp;
}
}
}
for(i=0;i<3;i++) printf("%d ",a[i]);
system("pause");
}