ChameL1oN

лаб 2 Мар 2 зад

Jun 17th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <locale>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. void main()
  9. {
  10. setlocale(LC_ALL, "rus");
  11. int x, y,n,k=0;
  12. cout << "введите количество чисел";
  13. cin >> n;
  14. int* mass = new int[n];
  15. for (int i = 0; i < n; i++)
  16. {
  17. cout << "введите число";
  18. cin >> mass[i];
  19. if (mass[i]%2 == 0) k = k + 1;
  20. }
  21. cout << "количество четных элементов равно" << k;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment