Last active
August 29, 2015 14:00
-
-
Save dd1994/79d00d57a6f55adb27cc to your computer and use it in GitHub Desktop.
This file contains 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> | |
void func(int a[100][100], int m, int n) | |
{ | |
int i, j; | |
for (i = 1; i < m; ++i) | |
{ | |
for (j = 0; j < n; ++j) | |
{ | |
printf("%d ", a[i][j]); | |
} | |
printf("\n"); | |
} | |
for (i = 0; i < n; ++i) | |
{ | |
printf("%d ", a[0][i]); | |
} | |
printf("\n"); | |
} | |
int main(void) | |
{ | |
int a[100][100], m, n, i, j; | |
while(scanf("%d %d", &m, &n) != EOF) { | |
//input | |
for (i = 0; i < m; ++i) | |
{ | |
for (j = 0; j < n; ++j) | |
{ | |
scanf("%d", a[i][j]); | |
} | |
} | |
func(a, m, n); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment