Computer Programming Contest Preparation

ToolBox - Source for: 3/357/a.c



/home/toolbox/public_html/solutions/3/357/a.c
    1 #include <stdio.h>
    2 #include <string.h>
    3 #include <sys/types.h>
    4 #include <sys/stat.h>
    5 #include <fcntl.h>
    6 #include <stdint.h>
    7 #include <math.h>
    8 #include <stdlib.h>
    9 #include <ctype.h>
   10 
   11 #define TRUE  (1 == 1)
   12 #define FALSE (1 != 1)
   13 
   14 #define DEBUG if (FALSE)
   15 
   16 #define MAX_LINE 257
   17 
   18 /*
   19  *  Author: Isaac Traxler
   20  *    Date: 20210-09-02
   21  * Purpose: fun
   22  * Problem: 357 - Let Me Count The Ways
   23  */
   24 
   25 /*
   26  * This template reads lines of data at a time until end of file.
   27  */
   28 
   29 #define MAX_NUMS 30001
   30 
   31 int num;
   32 int coins[5];
   33 int lst[MAX_NUMS];
   34 
   35 
   36 int count(int x)
   37 {
   38     /* FUNCTION count */
   39     int i;
   40     int cnt = 1;
   41 
   42 
   43 } /* FUNCTION count */
   44 
   45 void init()
   46 {
   47     /* FUNCTION init */
   48     int i;
   49 
   50     coins[0] = 1;
   51     coins[1] = 5;
   52     coins[2] = 10;
   53     coins[3] = 25;
   54     coins[4] = 50;
   55     lst[0] = 1;
   56     lst[1] = 1;
   57     lst[2] = 1;
   58     lst[3] = 1;
   59     lst[4] = 1;
   60     lst[5] = 2;
   61     lst[6] = 2;
   62     lst[7] = 2;
   63     lst[8] = 2;
   64     lst[9] = 2;
   65     for (i=10; MAX_NUMS>i; i=i+5)
   66         {
   67             /* do every 5th number */
   68             lst[i] = count(i);
   69         } /* do every 5th number */
   70 } /* FUNCTION init */
   71 
   72 void dump()
   73 {
   74     /* FUNCTION dump */
   75 } /* FUNCTION dump */
   76 
   77 int getInput()
   78 {
   79     /* FUNCTION getInput */
   80     int dataReadFlag;
   81 
   82     dataReadFlag = (1 == scanf(" %d ", &num));
   83     return (dataReadFlag);
   84 } /* FUNCTION getInput */
   85 
   86 void process()
   87 {
   88     /* FUNCTION process */
   89 } /* FUNCTION process */
   90 
   91 int main()
   92 {
   93     /* main */
   94     int moreToDo;
   95 
   96     init();
   97     moreToDo = getInput();
   98     while (moreToDo)
   99         {
  100             /* while */
  101             process();
  102             moreToDo = getInput();
  103         } /* while */
  104 
  105     return EXIT_SUCCESS;
  106 } /* main */
  107