Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
路总是要走的!#include <stdio.h> int main() { int cases,n,i,j,min,max; scanf("%d",&cases); while(cases--) { scanf("%d",&n); min=100; max=0; for(i=1;i<=n;i++) { scanf("%d",&j); if(j>max) max=j; if(j<min) min=j; } printf("%d\n",(max-min)*2); } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator