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

Which sentence would you use to introduce your brother to someone?
describe whale evolution
What does the Decleration of Independence reveal about Thomas Jefferson, it’s primary author?
If a sprinkler waters 1 over 15 of a lawn in 1 over 5 of an hour, how much time will it take to water the entire lawn? 2 hours 3 hours 10 hours 15 hours
Please answer this correctly
Patrick travels from A to B at an average speed of 8km/h and then he travels from B to C at an average speed of 6 km/h.It is given that Patrick travels 26.4 km
Est-ce que ton père a sommeil à minuit?
WHEN WAS THE FIRST CAR INVENTED?
A pair of parallel lines is cut by a transversal, as shown below:
#EASY WILL MARK BRAINLEST:D