Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int n = 5;
- int mat[n][n];
- bool math[n];
- int sum = 0, count = 0;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cin >> mat[i][j];
- }
- }
- for (int j = 0; j < n; j++) {
- for (int i = 0; i < n; i++) {
- for (int k = 1; k <= mat[i][j] / 2; k++) {
- if (mat[i][j] % k == 0) {
- sum += k;
- }
- }
- if (mat[i][j] == sum)
- count++;
- sum = 0;
- }
- if (count <= 3)
- math[j] = true;
- else
- math[j] = false;
- count = 0;
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cout << mat[i][j] << "\t";
- }
- cout << endl;
- }
- cout << endl;
- for (int i = 0; i < n; i++)
- cout << math[i] << "\t";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement