2 solutions

  • 0
    @ 2025-1-3 21:40:05
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,m;
        cin>>n>>m;
        int a=0;
        for(int i=1;i<=n;i++)
        {
        	int x;
        	cin>>x;
        	if(x==m)
        	{
        		a++;
    		}
    	}
    	cout<<a;
    	return 0;
    }
    
    • -3
      @ 2024-6-9 10:36:52
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int a,b,d,c=0,f=0;
      	cin>>a>>b;
      	while (a>c){
      		cin>>d;
      		if (d==b){
      			f++;
      		}
      		c++;
      	}
      	cout<<f;
      	return 0;
      } 
      
      • @ 2024-9-8 15:39:12

        **************# ###### 111


      • @ 2024-9-8 16:14:00

        ni ge da sha bi !!!!!!~~ ~~

      • @ 2024-9-8 16:14:32

        是错误答案不要抄

      • @ 2024-9-8 16:17:12

        #include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; int cnt = 0; for(int i = 1;i <= n;i++) { int x; cin>>x; if(x == m) { cnt++; } } cout<<cnt; return 0; }

      • @ 2024-9-8 16:17:29

        这是正解

      • @ 2025-1-3 21:40:39

        看不懂

    • 1

    Information

    ID
    38
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    115
    Accepted
    55
    Uploaded By