Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a[4][4], i, j,q2=0,q4=0;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- cin >> a[i][j];
- }
- }
- for (i = 0; i < 2; i++) {
- for (j = 2; j < 4; j++) {
- q2 += a[i][j];
- q4 += a[i+2][j];
- }
- }
- cout << "q2 = " << q2 << endl << "q4 = " << q4 << endl;
- float av;
- av = q2 / 4;
- cout << "The av of Second quarter : " << av << endl;
- av = q4 / 4;
- cout << "The av of Forth quarter : " << av << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment