遇到一个问题,大神帮我看看
/*(2)数组名作为函数参数。程序功能:用选择发对10个整数排序。*/#include<stdio.h>
void main ()
{
int *p,i,a[10];
p=a;
for (i=0;i<10;i++)
scanf("%d",p++);
p=a;
int sort (p,10);
for (p=a,i=0;i<10;i++)
{
printf("%5d",*p);
p++;}
printf("\n");
}
void sort (int x[],int n)
{
int i,j,k,t;
for (i=0;i<n-1;i++)
{
for (i=0;i<n-1:i++)
if (x[j]>x[k]) k=j;
if (k!=i)
{
t=x[i];x[i]=x[k];x[k]=t;
}
}
}
ompiling...
zhizhenyujiegouti02.c
E:\150807141141\zhizhenyujiegouti02.c(10) : error C2143: syntax error : missing ';' before 'type'
E:\150807141141\zhizhenyujiegouti02.c(10) : error C2143: syntax error : missing ';' before ')'
E:\150807141141\zhizhenyujiegouti02.c(22) : error C2143: syntax error : missing ';' before ':'
E:\150807141141\zhizhenyujiegouti02.c(22) : error C2143: syntax error : missing ')' before ':'
E:\150807141141\zhizhenyujiegouti02.c(22) : error C2143: syntax error : missing ';' before ':'
E:\150807141141\zhizhenyujiegouti02.c(22) : error C2059: syntax error : ')'
执行 cl.exe 时出错.
zhizhenyujiegouti02.obj - 1 error(s), 0 warning(s)
帮我看看,谢谢了