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

how many lawns can you mow with one gallon of gasoline if you maintain the rate of 1/2 gallon of gasoline per 1/4 lawn mowed
Which microscope uses a series of lenses to magnify an object in steps
I want to know what the answer to c=48y+.99n is so I may check my answer
Which is greater three sets of (5-2) or two sets of (2+3)
Imagine that an exchange student from China visits your class. While your teacher discusses how the United States has a limited government, the Chinese student
What is the next number 486, 162, 54, 18
Use f (x) and g (x) to evaluate each expression symbolically. f (x)=4x-x^3, g (x)=x+3 (A) (g+g)(-2) (B) (f-g)(0) (C) (gf)(1) (D) (g/f)(-3)
round 46952 to the nearest ten to the nearest hundred to the nearest thousand and to the nearest ten thousand
what is equality and how is it used to write conversion factor
what is 4 out of 20 as a decimal