#include #include #include int main(){ int *data,n,i,j,result; char *input,input_n[10],*point; fgets(input_n,sizeof(input_n),stdin); sscanf(input_n,"%d",&n); data=(int *)malloc(sizeof(int)*n); input=(char *)malloc(sizeof(char)*n*5+1); fgets(input,sizeof(char)*n*5+1,stdin); point=strtok(input," "); data[0]=atoi(point); for(i=1;idata[j+1]){ int save; save=data[j]; data[j]=data[j+1]; data[j+1]=save; } } } result=n%2;//nが奇数なら1 偶数なら0 if(result==1){ printf("%d\n",data[n/2]); } else if(result==0){ double answer=(data[n/2-1]+data[n/2])/2.0; printf("%.1f\n",answer); } free(data); free(input); return 0; }