1 solutions

  • 1
    @ 2026-1-3 11:25:21
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,z=0,f=0,l=0;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		int a;
    		cin>>a;
    		if(a<0)
    		{
    			f++;
    		}
    		else if(a==0)
    		{
    			l++;
    		}
    		else
    		{
    			z++;
    		}
    	}
    	cout<<f<<" "<<l<<" "<<z; 
    	return 0;
    }

    Information

    ID
    2839
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    1
    Tags
    # Submissions
    53
    Accepted
    38
    Uploaded By