Join the IDNLearn.com community and start finding the answers you need today. Discover detailed and accurate answers to your questions from our knowledgeable and dedicated community members.

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:

We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. For dependable and accurate answers, visit IDNLearn.com. Thanks for visiting, and see you next time for more helpful information.