#include #include int main() { int *even_elements( int *, int ); for ( ; ; ) { int elements, i, *t, *p; scanf( "%d", &elements ); if ( elements == 0 ) break; t = ( int * )malloc( elements * sizeof( int ) ); for ( i = 0; i < elements; ++i ) scanf( "%d", &t[ i ] ); p = even_elements( t, elements ); for ( i = 0; i <= p[ 0 ]; ++i ) { if ( i > 0 ) putchar( ' ' ); printf( "%d", p[ i ] ); } putchar( '\n' ); free( p ); free( t ); } return EXIT_SUCCESS; }