Last active
December 27, 2017 09:17
-
-
Save you74674/c49ec9de9caac19b21532b0545b6c52a 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> | |
#include "allocate.h" | |
void read_array(int *a, int len) | |
{ | |
for(int i=0; i<len; i++) | |
scanf("%d", &(a[i])); | |
} | |
void print_array(int *a, int len) | |
{ | |
for(int i=0; i<len; i++) | |
printf("%d ", a[i]); | |
printf("\n"); | |
} | |
int main() | |
{ | |
int C; | |
scanf("%d", &C); | |
for(int c=0; c<C; c++) | |
{ | |
int len; | |
int *a; | |
scanf("%d", &len); | |
a=allocate(len); | |
read_array(a, len); | |
print_array(a, len); | |
release(a); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment