以下是我的代码
#include<bits/stdc++.h>
using namespace std;
int n , sum , indes, a[15] ;
string s ;
char r ;
string in ;
int main(){
cin >> n ;
for(int i = 1 ; i <= n ; i ++){
for(int j = 1 ; j <= n ; j ++){
if(j == 1){
cin >> r ;
indes ++ ;
in[indes] = r ;
}else{
cin >> s ;
if(s.size() >= 2){
a[indes] ++ ;
}
}
}
}
for(int i = 2 ; i <= indes ; i ++){
cout << in[i] << "=" << a[i] << " " ;
}
cout << endl ;
cout << n - 1 ;
return 0;
}
求调