代码如下:
#include <iostream>
using namespace std;
long long t, n, num, a, tem;
int main()
{
cin >> t;
while (t--)
{
cin >> n;
tem = n;
while (n--)
{
cin >> a;
num += a;
}
cout << (num == (tem * a) ? tem : tem - 1) << '\n';
num = 0;
}
return 0;
}
希望能改对,而不要其他思路(如果可以),会给关