Welcome to Westonci.ca, your ultimate destination for finding answers to a wide range of questions from experts. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

Cho dãy A gồm N số nguyên a1,...aN. Hãy đếm tất cả các số âm hoặc không chia hết cho 5 trong dãy
( Mô phỏng thuật toán N=7
52, -32, 34, -45, -21, 35, 21 )


Sagot :

Answer:

#include<iostream>

int main()

{

int count=0;

int so_phan_tu;

std::cout << "nhap so phan tu : \n";

std::cin >> so_phan_tu;

int* A = new int[so_phan_tu];

std::cout << "nhap cac phan tu : \n";

for (int i = 0; i < so_phan_tu; i++)

{

 std::cin >> A[i];

 if (A[i] % 5 == 0)

 {

  count++;

 }

}

std::cout << so_phan_tu - count;

system("pause");

return 0;

}

//cái này viết bằng C++ em nhé

Explanation: