60分 #2#5不过
查看原帖
60分 #2#5不过
716488
a_study_xxs楼主2024/2/26 21:40

以下是我的代码

#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;
}

求调

2024/2/26 21:40
加载中...