Computer Programming Contest Preparation

ToolBox - Source for: 117/11727/a.c



/home/toolbox/public_html/solutions/117/11727/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: 2014010-26
   20  * Purpose: UVA Hack-a-thon
   21  * Problem: 11727
   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     int t;
   54 
   55     if (a < b)
   56         {
   57             /* a < b */
   58             t = a;
   59             a = b;
   60             b = t;
   61         } /* a < b */
   62 
   63     if (b < c)
   64         {
   65             /* b < c */
   66             t = b;
   67             b = c;
   68             c = t;
   69         } /* b < c */
   70 
   71     if (a < b)
   72         {
   73             /* a < b */
   74             t = a;
   75             a = b;
   76             b = t;
   77         } /* a < b */
   78     printf("%d\n", b);
   79 } /* FUNCTION process */
   80 
   81 int main ()
   82 {
   83     /* main */
   84     int i;
   85 
   86     init();
   87     for (i=0; i<numberOfTimes; i++)
   88         {
   89             /* while */
   90             getInput();
   91             printf("Case %d: ", i+1);
   92             process();
   93         } /* while */
   94 
   95     return EXIT_SUCCESS;
   96 } /* main */
   97 
   98