Computer Programming Contest Preparation

ToolBox - Source for: 4/440/a.c



/home/toolbox/public_html/solutions/4/440/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 
   10 #define TRUE  (1 == 1)
   11 #define FALSE (1 != 1)
   12 
   13 #define DEBUG if (FALSE)
   14 
   15 /*
   16  *  Author: Isaac Traxler
   17  *    Date: 2020-04-21
   18  * Purpose: fun
   19  * Problem: 440 Eeny Meeny Moo
   20  */
   21 
   22 /*
   23  * This template reads data until a terminating value is reached.
   24  */
   25 
   26 int b[151];
   27 int num;
   28 
   29 void init()
   30 {
   31     /* FUNCTION init */
   32 } /* FUNCTION init */
   33 
   34 void initb(int x)
   35 {
   36     /* FUNCTION init */
   37     int i;
   38 
   39     for (i=2; i<x; i++)
   40         {
   41             /* fill */
   42             b[i] = 1;
   43         } /* fill */
   44 } /* FUNCTION init */
   45 
   46 void dump()
   47 {
   48     /* FUNCTION dump */
   49 } /* FUNCTION dump */
   50 
   51 int getInput()
   52 {
   53     /* FUNCTION getInput */
   54     int dataReadFlag;
   55 
   56     scanf(" %d ", &num);
   57     dataReadlag = (0 != num);
   58     return (dataReadFlag);
   59 } /* FUNCTION getInput */
   60 
   61 void process()
   62 {
   63     /* FUNCTION process */
   64     int try = 2;
   65     int keepGoing = TRUE;
   66     int cur;
   67 
   68     cur = 1;
   69     while (keepGoing)
   70         {
   71             /* while */
   72             initb(num);
   73             cur = 1;
   74             for
   75         } /* while */
   76 
   77 init
   78 } /* FUNCTION process */
   79 
   80 int main()
   81 {
   82     /* main */
   83     int moreToDo;
   84 
   85     init();
   86     moreToDo = getInput();
   87     while (moreToDo)
   88         {
   89             /* while */
   90             process();
   91             moreToDo = getInput();
   92         } /* while */
   93 
   94     return EXIT_SUCCESS;
   95 } /* main */
   96