quarta-feira, 24 de outubro de 2018

URI PROBLEMA 1052 - Mês SOLUÇÃO EM C



URI Online Judge | 1052

Mês

Adaptado por Neilor Tonin, URI  Brasil
Timelimit: 1
Leia um valor inteiro entre 1 e 12, inclusive. Correspondente a este valor, deve ser apresentado como resposta o mês do ano por extenso, em inglês, com a primeira letra maiúscula.

Entrada

A entrada contém um único valor inteiro.

Saída

Imprima por extenso o nome do mês correspondente ao número existente na entrada, com a primeira letra em maiúscula.



URI Online Judge | 1052

Month

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read an integer number between 1 and 12, including. Corresponding to this number, you must print the month of the year, in english, with the first letter in uppercase.

Input

The input contains only an integer number.

Output

Print the name of the month according to the input number, with the first letter in uppercase.


#include <stdio.h>

int main() {
 
 int X;
scanf("%d",&X);
 if (X==1)
       printf("January\n");
    else
       if (X==2)
          printf("February\n");
          else
       if (X==3)
          printf("March\n");
          else
       if (X==4)
          printf("April\n");
          else
       if (X==5)
          printf("May\n");
          else
       if (X==6)
          printf("June\n");
          else
       if (X==7)
          printf("July\n");
          else
       if (X==8)
          printf("August\n");
          else
       if (X==9)
          printf("September\n");
          else
       if (X==10)
          printf("October\n");
          else
       if (X==11)
          printf("November\n");
          else
       if (X==12)
          printf("December\n");

    return 0;
}

Nenhum comentário:

Postar um comentário

URI PROBLEMA 1133 - Resto da Divisão SOLUÇÃO EM C

URI Online Judge | 1133 Resto da Divisão Adaptado por Neilor Tonin, URI   Brasil Timelimit: 1 Escreva um programa que leia 2 valo...