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