Skip to content

Instantly share code, notes, and snippets.

@dd1994
Last active August 29, 2015 14:00
Show Gist options
  • Save dd1994/79d00d57a6f55adb27cc to your computer and use it in GitHub Desktop.
Save dd1994/79d00d57a6f55adb27cc to your computer and use it in GitHub Desktop.
#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