输入15个数从大到小组成的数组,再输入1个数,在其中要说明在第几个位置,不在的话说明不在。
最后说明的地方我做出来会说明15次,快晕死了,谁能帮我啊?给个源代码~先谢过各位了~!
main()
{int a[15];
int x,y,z,m;
printf("\nPlease input 15 numbers=\n");
for (x=0;x<15;x++)
scanf(" %d",&a[x]);
printf("\n");
for(y=0;y<=14;y++)
for (x=0;x<=15-y;x++)
if(a[x]<a[x+1]) {z=a[x];a[x]=a[x+1];a[x+1]=z;}
printf(" the order is:\n");
for (x=0;x<15;x++)
printf(" %d ",a[x]);
printf("\nplease input No.16 number\n");
scanf("%d",&m);
for(x=0;x<16;x++)
if(m==a[x] )
printf("It is the %dth a[x]",x+1);
else printf("No one is the same");
}