```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 ``` ```#include #include #define MAX_DONG 100 #define MAX_COT 100 void Nhap_Mang_2_Chieu(int arr[][MAX_COT],int dong,int cot) { for(int i = 0; i < dong; i++) { for(int j = 0; j < cot; j++) { printf("\nHay nhap gia tri cho arr[%d][%d]: ",i,j); scanf("%d",&arr[i][j]); } } } void Xuat_Mang_2_Chieu(int arr[][MAX_COT],int dong,int cot) { for(int i = 0; i < dong; i++) { for(int j = 0; j < cot; j++) { printf("\t%d",arr[i][j]); } printf("\n"); } } bool So_Nguyen_To(int n) { if(n == 2) { return true; } else if(n < 2) { return false; } else if(n > 2) { for(int i = 2; i < n; i++) { if(n % i == 0) { return false; } } } return true; } int Tinh_Tong(int arr[][MAX_COT],int dong,int cot) { int Sum = 0; for(int i = 0; i < dong; i++) { for(int j = 0; j < cot; j++) { if(So_Nguyen_To(arr[i][j] == true)) { Sum += arr[i][j]; } } } printf("\nTong cac phan tu la so nguyen to trong ma tran la:%d",Sum); } int main() { int arr[MAX_DONG][MAX_COT]; int dong; int cot; do { printf("\nHay nhap so dong: "); scanf("%d",&dong); printf("\nHay nhap so cot: "); scanf("%d",&cot); if(dong < 1 || dong > MAX_DONG || cot < 1 || cot > MAX_COT) { printf("\nGia tri ban vua nhap khong hop le,hay nhap lai: "); } } while(dong < 1 || dong > MAX_DONG || cot < 1 || cot > MAX_COT); printf("\n\tNHAP GIA TRI CUA MANG 2 CHIEU:\n"); Nhap_Mang_2_Chieu(arr,dong,cot); printf("\n\tXUAT GIA TRI CUA MANG 2 CHIEU:\n "); Xuat_Mang_2_Chieu(arr,dong,cot); Tinh_Tong(arr,dong,cot); } ```
 ```1 2 3 4 5 6 7 8 9 10 11 ``` ```In function 'Nhap_Mang_2_Chieu': Line 7: error: 'for' loop initial declaration used outside C99 mode Line 8: error: 'for' loop initial declaration used outside C99 mode In function 'Xuat_Mang_2_Chieu': Line 16: error: 'for' loop initial declaration used outside C99 mode Line 17: error: 'for' loop initial declaration used outside C99 mode In function 'So_Nguyen_To': Line 30: error: 'for' loop initial declaration used outside C99 mode In function 'Tinh_Tong': Line 41: error: 'for' loop initial declaration used outside C99 mode Line 42: error: 'for' loop initial declaration used outside C99 mode ```