Computer Programming Contest Preparation

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



/home/toolbox/public_html/solutions/117/11799/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: 2015-03-13
   20  * Purpose:
   21  * Problem: 11799
   22  */
   23 
   24 /*
   25  * This template reads data a specified number of times.
   26  */
   27 
   28 int numberOfTimes;
   29 int mx;
   30 
   31 void init()
   32 {
   33     /* FUNCTION init */
   34     scanf("%d ", &numberOfTimes);
   35 } /* FUNCTION init */
   36 
   37 void dump()
   38 {
   39     /* FUNCTION dump */
   40 } /* FUNCTION dump */
   41 
   42 void getInput()
   43 {
   44     /* FUNCTION getInput */
   45     int i;
   46     int cnt;
   47     int tmp;
   48 
   49     scanf(" %d ", &cnt);
   50     mx = 0;
   51     for (i=0; i<cnt; i++)
   52         {
   53             /* for */
   54             scanf(" %d ", &tmp);
   55             if (tmp > mx)
   56                 {
   57                     mx = tmp;
   58                 }
   59         } /* for */
   60 } /* FUNCTION getInput */
   61 
   62 void process(int cse)
   63 {
   64     /* FUNCTION process */
   65     printf("Case %d: %d\n", cse, mx);
   66 } /* FUNCTION process */
   67 
   68 int main()
   69 {
   70     /* main */
   71     int i;
   72 
   73     init();
   74     for (i=1; i<=numberOfTimes; i++)
   75         {
   76             /* while */
   77             getInput();
   78             process(i);
   79         } /* while */
   80 
   81     return EXIT_SUCCESS;
   82 } /* main */
   83 
   84