我的
代码
这题test case not found, 我也不知道我写的对不对
#include<iostream>
using namespace std;
void func(int** a, int n){
int count[n] = {0}; //记录每个芯片被测试为好芯片的次数
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j)
count[i] += a[i][j];
if(count[i] > n / 2) //count>半数的一定是好芯片
cout << i + 1 << " ";
}
}
int main(){
int** a, n;
cin >> n;
a = new int*[n];
for (int i = 0; i < n; ++i)
a[i] = new int[n];
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
cin >> a[i][j];
func(a, n);
return 0;
}