2 条题解

  • 0
    @ 2024-2-17 23:19:26
    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        int n=0,h=0,i=1,i2;
        cin>>i2;
        while(i<=i2)
        {
            scanf("%d ",&n);
            if(n%2==0)
            {
                h=h+n;
            }
            i++;
        }
        cout<<h;
        return 0;
    }
    
    • 0
      @ 2023-11-18 15:33:21
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n,m,s=0;
      	cin>>n;
      	for(int i=1;i<=n;i++){
      		cin>>m;
      		if(m%2==0){
      			s=s+m;
      		}
      	}
      	cout<<s;
      	return 0;
      }
      
      • 1

      信息

      ID
      63
      时间
      1000ms
      内存
      64MiB
      难度
      6
      标签
      递交数
      45
      已通过
      14
      上传者