lehoangvietha746 lehoangvietha746
  • 07-11-2021
  • Computers and Technology
contestada

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 )

Respuesta :

hieule1235 hieule1235
  • 07-11-2021

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:

Answer Link

Otras preguntas

What is the other name for artificial kidney?
What is the nature of the distance time graph for motion of an object.
What happens to the carbon dioxide which collected in human tissues?
define the term volt.
400J of heat is produced in 4 sec in 4ohm resistor.calculate yhe PD across the resistor.
Why evaporation are called surface phenomenon?
If a grocery cart with a mass of 16.5 kg accelerates at +2.31 m/s2 against a frictional force of -15.0 N, what is the applied force?
What's the value of X
Question 17 options:A 71.8 kg man goes from an area where the acceleration due to gravity is 9.79 m/s2 to an area where the acceleration due to gravity is 9.82
What is the other name for artificial kidney?