标签:io for 2014 amp c return print include
#include <stdio.h>
int main()
{
int T,a[100];
scanf("%d",&T);
while(T--)
{
int n,i,j,sum,t;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(j=0;j<n-1;j++)
{
for(i=0;i<n-1-j;i++)
{
if(a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
}
}
sum=a[n-1]-a[0];
printf("%d\n",sum);
}
return 0;
}
题目238-小明的调查统计-nyoj20140804,布布扣,bubuko.com
标签:io for 2014 amp c return print include
原文地址:http://www.cnblogs.com/xiaziteng/p/3891475.html