Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int _tmain(int argc, _TCHAR* argv[])
  7. {
  8. const int m = 5, n = 5;
  9. int A[m][n];
  10. int i, j;
  11. int sum;
  12. sum = 0;
  13. srand(time(0));
  14. for (i = 0; i <= m; i++)
  15. {
  16. for (j = 0; j <= n; j++)
  17. {
  18. A[i][j] = rand() % 20;
  19. cout << A[i][j];
  20. }
  21. }
  22. for (i = 0; i <= m; i++)
  23. {
  24. for (j = 0; j <= n; j++)
  25. {
  26. if ((A[i][j] % 2) == 0)
  27. sum++;
  28. cout << "\nYour res: " << sum;
  29. }
  30. }
  31. //cout << "\nYour res: " << sum;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement