Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- const int x = 4;
- int main()
- {
- int niz[x][x];
- for (int i = 0; i < x; i++)
- {
- for (int j = 0; j < x; j++)
- {
- cin >> niz[i][j];
- }
- }
- system("pause");
- return 0;
- }
- int suma(int niz[][x])
- {
- int suma = 0;
- for (int i = 0; i < x; i++)
- {
- for (int j = 0; j < x; j++)
- {
- if (i == j)
- {
- if (niz[i][j] % 3 == 0)
- suma += niz[i][j];
- }
- }
- }
- return suma;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement