Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float* Average(int** Matrixx, int n)
- {
- float Sum, Amount;
- float *Arr = new float[n];
- for (int i = 0; i < n; i++) {
- Sum = 0;
- Amount = 0;
- for (int j = 0; j < n; j++) {
- if (Matrixx[j][i] > 0) {
- Sum += Matrixx[j][i];
- Amount += 1;
- }
- Arr[i] = Sum / Amount;
- }
- }
- return Arr;
- }
Advertisement
Add Comment
Please, Sign In to add comment