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

Mr. Conrad's pecan pie recipe calls for 1 3/4 cups of pecans. He plans to make 6 pies for his family reunion. How many cups of pecans will Mr. Conrad need
What is 1/5 + 3/10 =
Find two prime numbers between 60 and 90
When a country is not at war or engaged in hostilities, it is said to be at ... - rest - armistice - conflict - peace
6.52 or 6.520 which is greater
what is £400 increased by 3.2%
When Marla rounded 19.95 to the nearest tenth she found the number change to 20 is this correct. Explain
which is the Real goddess of love, Amora or Aphrodite?
How many years would it take you to eat a billion hamburgers
"It was an awful, endless day. The heat was sickening, scorching, melting, unbearable. 1.The word day is (A) a direct object (B) a predicate noun (C) not a comp
good job