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

___________ transport moves substances from an area of high concentration to an area of low concentration.
Where did James Oglethorpe and the first Georgia colonist land when they arrived in Georgia
Communicating with people you know or meet to share information or advice about a job defines a contact list b. job leads C. networking d career fair
"You know- too many cooks stink up the kitchen." idiom metaphor hyperbole personification
10 POINTS.. ILL GIVE BRAINLIEST Solve for x: a) x = 18 b) x = 19 c) X = 20 d) x = 21
How many different tick marks can you have on a picture?
It's the (IV) question with the spinning sector really need this answer anything will be appreciated it's got to do with probability
Help I’m so confused.
4x+5 equivalent expression
Which best summarize the results of Mendel's pea plant experience