3 solutions

  • 1
    @ 2026-2-23 11:32:04
    #include<bits/stdc++.h>
    using namespace std;
    int main() {
        int n;
        cin>>n;
        int js=0;
        int os=0;
        for(int i=0;i<n;i++){
            int t;
            cin>>t;
    
            if(t%2==0){
                js++;
            }else{
                os++;
            }
        }
        cout<<os<<" "<<js;
        return 0;
    }
    
    
    • -1
      @ 2026-1-25 11:27:51
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n,a=0,b=0;cin>>n;
          for(int i=0;i<n;i++)
          {
              int c;
              cin>>c;
              if(c%2==0)a++;
              else b++;
          }
          cout<<b<<" "<<a;
      }
      
      • -1
        @ 2025-11-27 11:54:18

        C++ :

        #include<bits/stdc++.h>
        using namespace std;
        int main() {
            int n;
            cin>>n;
            int js=0;
            int os=0;
            for(int i=0;i<n;i++){
                int t;
                cin>>t;
        
                if(t%2==0){
                    js++;
                }else{
                    os++;
                }
            }
            cout<<os<<" "<<js;
            return 0;
        }
        
        • 1

        Information

        ID
        9
        Time
        1000ms
        Memory
        128MiB
        Difficulty
        4
        Tags
        # Submissions
        31
        Accepted
        18
        Uploaded By