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uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

Lời giải 1 :

#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int n,s,x=0;
    cin >> n;
    for (int i=1; i<=n; i++){
        cin>>s;
        if(s%2==0)x+=s;
    cout<<x;
    return 0;
}

Lời giải 2 :

#include <bits/stdc++.h>
using namespace std;
long long tt, s = 0;
int main()
{
 cin >> tt;
 while (tt--)
 {
  long long n;
  cin >> n;
  s += (n % 2 == 0 ? n : 0);
 }
 cout << s;
}

 

Bạn có biết?

Tin học là một ngành khoa học chuyên nghiên cứu quá trình tự động hóa việc tổ chức, lưu trữ, xử lý và truyền dẫn thông tin của một hệ thống máy tính cụ thể hoặc trừu tượng. Tin học bao hàm tất cả các nghiên cứu và kỹ thuật có liên quan đến việc mô phỏng, biến đổi và tái tạo thông tin. Hãy tận dụng sức mạnh của tin học để giải quyết các vấn đề và sáng tạo ra những giải pháp mới!

Nguồn :

Wikipedia - Bách khoa toàn thư

Tâm sự lớp 7

Lớp 7 - Năm thứ hai ở cấp trung học cơ sở, một chuỗi quay mới lại đến và chúng ta vẫn bước tiếp trên con đường học sinh. Học tập vẫn là nhiệm vụ chính, hãy luôn kiên trì và không ngừng cố gắng!

Nguồn :

sưu tập

Copyright © 2024 Giai BT SGK