爵士 (模拟) 水题

在这里插入图片描述
在这里插入图片描述
思路:这个真就是一个水题=-=

#include <bits/stdc++.h>
using namespace std;

int main()
{
    
    
    int t; cin>>t;
    while(t--){
    
    
        double count1 = 0;
        int n; cin>>n; getchar();
        for(int i=0;i<n;i++){
    
    
            string s;  getline(cin,s);
            if(s.find('2')!=-1) count1++;
        }
        double ans=count1/n;
       cout<<ans<<endl;

    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_43811879/article/details/108206770