Computer Programming Contest Preparation

ToolBox - Source for: 123/12372/a.c



/home/toolbox/public_html/solutions/123/12372/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 <stdlib.h>
    7 #include <math.h>
    8 #include <stdint.h>
    9 
   10 #define TRUE  (1 == 1)
   11 #define FALSE (1 != 1)
   12 
   13 #define DEBUG if (FALSE)
   14 
   15 /* fprintf(stderr, "functionName: message", varslist); */
   16 
   17 /*
   18  *  Author: Isaac Traxler
   19  *    Date: 2014-10-26
   20  * Purpose: UVA Hack-a-thon
   21  * Problem: 12372 - Packing for Holiday
   22  */
   23 
   24 /*
   25  * This template reads data a specified number of times.
   26  */
   27 
   28 int numberOfTimes;
   29 int a;
   30 int b;
   31 int c;
   32 
   33 void init()
   34 {
   35     /* FUNCTION init */
   36     scanf("%d ", &numberOfTimes);
   37 } /* FUNCTION init */
   38 
   39 void dump()
   40 {
   41     /* FUNCTION dump */
   42 } /* FUNCTION dump */
   43 
   44 void getInput()
   45 {
   46     /* FUNCTION getInput */
   47     scanf(" %d %d %d ", &a, &b, &c);
   48 } /* FUNCTION getInput */
   49 
   50 void process()
   51 {
   52     /* FUNCTION process */
   53     if ((21 > a) && (21 > b) && (21 > c))
   54         printf("good\n");
   55     else
   56         printf("bad\n");
   57 } /* FUNCTION process */
   58 
   59 int main ()
   60 {
   61     /* main */
   62     int i;
   63 
   64     init();
   65     for (i=0; i<numberOfTimes; i++)
   66         {
   67             /* while */
   68             getInput();
   69             printf("Case %d: ", i+1);
   70             process();
   71         } /* while */
   72 
   73     return EXIT_SUCCESS;
   74 } /* main */
   75 
   76