9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia02/ex05.c (1022B)
   1 #include <stdio.h>
   2 
   3 typedef enum {
   4     JAN, FEB, MAR, APR, MAY, JUN, JUL, AGO, SEP, OCT, NOV, DEC
   5 } mes_t;
   6 
   7 #define JANUARY        "ENERO"
   8 #define FEBRUARY    "FEBRERO"
   9 #define MARCH         "MARZO"
  10 #define APRIL        "ABRIL"
  11 #define MAYO        "MAYO"
  12 #define JUNE        "JUNIO"
  13 #define JULY        "JULIO"
  14 #define AUGUST        "AGOSTO"
  15 #define SEPTEMBER    "SEPTIEMBRE"
  16 #define OCTOBER        "OCTUBRE"
  17 #define NOVEMBER    "NOVIEMBRE"
  18 #define DECEMBER    "DICIEMBRE"
  19 
  20 int main(void) {
  21     mes_t mes = NOV;
  22     switch(mes)
  23     {
  24         case JAN:
  25             printf(JANUARY"\n");
  26             break;
  27         case FEB:
  28             printf(FEBRUARY"\n");
  29             break;
  30         case MAR:
  31             printf(MARCH"\n");
  32             break;
  33         case APR:
  34             printf(APRIL"\n");
  35             break;
  36         case MAY:
  37             printf(MAYO"\n");
  38             break;
  39         case JUN:
  40             printf(JUNE"\n");
  41             break;
  42         case JUL:
  43             printf(JULY"\n");
  44             break;
  45         case AGO:
  46             printf(AUGUST"\n");
  47             break;
  48         case SEP:
  49             printf(SEPTEMBER"\n");
  50             break;
  51         case OCT:
  52             printf(OCTOBER"\n");
  53             break;
  54         case NOV:
  55             printf(NOVEMBER"\n");
  56             break;
  57         case DEC:
  58             printf(DECEMBER"\n");
  59             break;
  60     }    
  61     return 0;
  62 }