Computer Programming Contest Preparation

ToolBox - Source for: 126/12614/a.c



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