Computer Programming Contest Preparation

ToolBox - Source for: 129/12952/a.c



/home/toolbox/public_html/solutions/129/12952/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 #include <ctype.h>
   10 
   11 #define TRUE  (1 == 1)
   12 #define FALSE (1 != 1)
   13 
   14 #define DEBUG if (FALSE)
   15 
   16 #define MAX_LINE 257
   17 
   18 /*
   19  *  Author: Isaac Traxler
   20  *    Date: 2021-12-16
   21  * Purpose: fun
   22  * Problem: 12952 - Tri-du
   23  */
   24 
   25 /*
   26  * This template reads lines of data at a time until end of file.
   27  */
   28 
   29 int a;
   30 int b;
   31 
   32 void init()
   33 {
   34     /* FUNCTION init */
   35 } /* FUNCTION init */
   36 
   37 void dump()
   38 {
   39     /* FUNCTION dump */
   40 } /* FUNCTION dump */
   41 
   42 int getInput()
   43 {
   44     /* FUNCTION getInput */
   45     int dataReadFlag;
   46 
   47     dataReadFlag = (2 == scanf(" %d %d ", &a, &b));
   48     return (dataReadFlag);
   49 } /* FUNCTION getInput */
   50 
   51 void process()
   52 {
   53     /* FUNCTION process */
   54     if (a > b)
   55         {
   56             printf("%d\n", a);
   57         }
   58     else
   59         {
   60             printf("%d\n", b);
   61         }
   62 } /* FUNCTION process */
   63 
   64 int main()
   65 {
   66     /* main */
   67     int moreToDo;
   68 
   69     init();
   70     moreToDo = getInput();
   71     while (moreToDo)
   72         {
   73             /* while */
   74             process();
   75             moreToDo = getInput();
   76         } /* while */
   77 
   78     return EXIT_SUCCESS;
   79 } /* main */
   80