Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- const int m = 5, n = 5;
- int A[m][n];
- int i, j;
- int sum;
- sum = 0;
- srand(time(0));
- for (i = 0; i <= m; i++)
- {
- for (j = 0; j <= n; j++)
- {
- A[i][j] = rand() % 20;
- cout << A[i][j];
- }
- }
- for (i = 0; i <= m; i++)
- {
- for (j = 0; j <= n; j++)
- {
- if ((A[i][j] % 2) == 0)
- sum++;
- cout << "\nYour res: " << sum;
- }
- }
- //cout << "\nYour res: " << sum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement