poj 3637(水题)
作者:互联网
#include<iostream> #include<algorithm> using namespace std; int main(){ int t,n,sum,data[20005]; scanf("%d",&t); while(t--){ scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&data[i]); } sort(data,data+n); sum = 0; for(int i=n-3;i>-1;i-=3){ sum += data[i]; } printf("%d\n",sum); } return 0; }
标签:std,水题,int,3637,sum,poj,include,data,scanf 来源: https://www.cnblogs.com/stevenzrx/p/15628103.html