#include using namespace std; #define M 100 void NhapMang(int a[][M], int row, int col) { for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { cout << "a[" << i << "][" << j << "]:"; cin >> a[i][j]; } cout << endl; } } void XuatMang(int a[][M], int row, int col) { for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { cout << a[i][j] << "\t"; } cout << endl; } } int Tongduongcheophu(int a[][M], int row, int col) { int sum = 0; for (int i = 0; i < row;) { for (int j = col-1; j >=0; j--) { sum += a[i][j]; i++; continue; } } return sum; } int main() { int a[M][M], row, col; cout << "Mang A" << endl; cout << "Input row:"; cin >> row; cout << "Input collum:"; cin >> col; NhapMang(a, row, col); XuatMang(a, row, col); cout << "Sum duong cheo phu la:" << Tongduongcheophu(a, row, col); return 1; }