杭电acm2304

#include <stdio.h>

int main(){

	int t, i, sum, num, n;
	scanf("%d", &t);
       while(t--){
  	       scanf("%d", &n);
		   sum = 0;
  	       for(i=0; i<n; i++){
	   			scanf("%d", &num);
	   			sum += num;
		   }
		   printf("%d\n", sum-n+1);
 	  }
		

	return 0;
}

你可能感兴趣的:(ACM,HDU)