2 3 4 1 1 5 5 4 3 2 1
No YesPlease use function scanfHintHint
#include<stdio.h> int main() { int T; scanf("%d",&T); while(T--) { double sum=0;int N,max=-1,t; scanf("%d",&N); for(int i=0;i<N;i++) { scanf("%d",&t); sum+=t; if(t>max) max=t; } sum-=max; if(sum>=max-1) printf("Yes\n"); else printf("No\n"); } return 0; }
原文地址:http://blog.csdn.net/lsgqjh/article/details/44763557