# include # include # include # include # include "subset_sum.h" int main ( ); /******************************************************************************/ int main ( ) /******************************************************************************/ /* Purpose: subset_sum_test() tests subset_sum(). Licensing: This code is distributed under the MIT license. Modified: 05 November 2022 Author: John Burkardt */ { timestamp ( ); printf ( "\n" ); printf ( "subset_sum_test()::\n" ); printf ( " C version\n" ); printf ( " Test subset_sum().\n" ); subset_sum_count_tests ( ); subset_sum_find_tests ( ); subset_sum_table_tests ( ); /* Terminate. */ printf ( "\n" ); printf ( "subset_sum_test():\n" ); printf ( " Normal end of execution.\n" ); printf ( "\n" ); timestamp ( ); return 0; } /******************************************************************************/ void timestamp ( ) /******************************************************************************/ /* Purpose: timestamp() prints the current YMDHMS date as a time stamp. Example: 31 May 2001 09:45:54 AM Licensing: This code is distributed under the MIT license. Modified: 24 September 2003 Author: John Burkardt */ { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; now = time ( NULL ); tm = localtime ( &now ); strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); fprintf ( stdout, "%s\n", time_buffer ); return; # undef TIME_SIZE }