Last active
November 28, 2017 03:55
-
-
Save behitek/551f526edce149301a55e2f3d539bd40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
int m,n; | |
int a[100][100]; | |
printf("\nNhap so hang, so cot: "); | |
scanf("%d%d", &m, &n); | |
// Nhap mang 2 chieu | |
for(int i = 0;i < m;i++){ | |
for(int j = 0; j < n;j++){ | |
printf("\nNhap a[%d][%d] = ", i, j); | |
scanf("%d",&a[i][j]); | |
} | |
} | |
for(int i = 0;i < m;i++){ | |
for(int j = 0; j < n;j++){ | |
printf("%d ",a[i][j]); | |
} | |
printf("\n"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int i,j,h; | |
long long tong; | |
int a[100][100]; | |
scanf("%d",&h); | |
for(i=0;i<h;i++){ | |
for(j=0;j<h;j++){ | |
scanf("%d",&a[i][j]); | |
} | |
} | |
tong=0; | |
for(i=0;i<h;i++){ | |
for(j=0;j<h;j++){ | |
if(i%2==0 || j%2==0){ | |
tong+=a[i][j]; | |
} | |
} | |
} | |
printf("%ld",tong); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment