Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "stdio.h"
- #include "conio.h"
- #include "math.h"
- #include "iostream"
- using namespace System;
- using namespace std;
- const int I = 3;
- const int J = 4;
- void vvod(int A[I][J])
- {
- int i, j;
- for (i = 0; i < I; i++)
- {
- cout << "\n";
- for (j = 0; j < J; j++)
- {
- cout << "A[" << i << "][" << j << "] = ";
- cin >> A[i][j];
- }
- }
- }
- int srednee(int A[I][J], int j)
- {
- int i;
- float sum = 0;
- for (i = 0; i < I; i++)
- {
- sum = sum + A[i][j];
- }
- sum = sum / 3;
- cout << sum << ", ";
- }
- void main()
- {
- int A[I][J];
- vvod(A);
- srednee(A, 0);
- srednee(A, 1);
- srednee(A, 2);
- srednee(A, 3);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement