6 solutions

  • 2
    @ 2026-8-6 13:55:22
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m,x,z=0;
    	cin>>n>>m;
    	for(int i=1;i<=n;i++)
        {   cin>>x;
    		if(x==m)
    		{
    			z++;
    		}
    	}
    	cout<<z;
    	return 0; 
    }
    
    • 1
      @ 2026-8-6 11:31:57
      给我点赞的是彭于晏
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int a,b;
      	cin>>a>>b;
      	int c=0;
      	for(int i=1;i<=a;i++)
      	{
      		int d;
      		cin>>d;
      		if (d==b)
      		{
      			c=c+1;
      		}
      	}
      	cout<<c;
      	return 0;
      }
      
      • 0
        @ 2026-11-7 15:02:39

        1

        • -1
          @ 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;
          }
          
          • -2
            @ 2025-11-2 14:04:12
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
            	int a,b;
            	cin>>a>>b;
            	int c=0;
            	for(int i=1;i<=a;i++)
            	{
            		int d;
            		cin>>d;
            		if (d==b)
            		{
            			c=c+1;
            		}
            	}
            	cout<<c;
            
            
            	return 0;
            }	
            
            • -5
              @ 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 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
            226
            Accepted
            121
            Uploaded By