4 solutions

  • 3
    @ 2024-1-27 10:38:11
    #include<bits/stdc++.h>
    using namespace std;
    int n,m;
    int a[105];
    int s=0;
    int main(){
    	cin>>n>>m;
    	for(int i=0;i<n;i++){
    		cin>>a[i];
    		if(a[i]==m) s++;
    	}
    	cout<<s<<endl;
    	return 0;
    }
    
    • 3
      @ 2023-9-17 11:57:39
      #include<bits/stdc++.h>
      using namespace std;
      int n,m,cnt=0;
      signed main(){
      	cin>>n>>m;
      	for(int i=1,t;i<=n;i++){
      		cin>>t;
      		if(t==m) cnt++;
      	}
      	cout<<cnt<<endl;
      	return 0;
      }
      //完美的代码,点个赞吧
      
      • 1
        @ 2023-9-23 18:52:26

        #include<bits/stdc++.h> using namespace std; int main(){ long long N,m,a,z=0; cin>>N>>m; for(int i=1;i<=N;i++){ cin>>a; if(a==m){ z++; } } cout<<z; }

        • 1
          @ 2023-9-16 17:03:00

          #include<bits/stdc++.h>

          using namespace std;

          int main()

          {

          int N, m, t, cnt = 0;

          cin >> N >> m;

          for (int i = 1; i <= N; i++)

          {

          cin >> t;

          if (t == m) cnt++;

          }

          cout << cnt;

          return 0;

          }

          //点个赞吧!——李尤

          • 1

          Information

          ID
          557
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          1
          Tags
          # Submissions
          37
          Accepted
          32
          Uploaded By