Created
May 12, 2014 03:17
-
-
Save dd1994/cba70c245f96e192c773 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 input(int *, int); | |
void output(int *, int); | |
int main(void) | |
{ | |
int a[100], n; | |
while(scanf("%d", &n) != EOF) { | |
input(a, n); | |
output(a, n); | |
} | |
return 0; | |
} | |
void input(int *a, int n) | |
{ | |
int i; | |
for (i = 0; i < n; ++i) | |
{ | |
scanf("%d", a + i); | |
} | |
} | |
void output(int *a, int n) | |
{ | |
int i; | |
for (i = 0; i < n - 1; ++i) | |
{ | |
printf("%d ", a[i]); | |
} | |
printf("%d\n",a[n-1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment