Advertisement
diogoAlves

IFF/Introdução à Programação/Lista/18

Feb 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Lista de Exercícios - 18
  3. #include<stdio.h>
  4. #include<locale.h>
  5.  
  6. int main(){
  7.     setlocale(LC_ALL,"Portuguese");
  8.     int idade;
  9.     printf("Entre com a idade do nadador: ");
  10.     scanf("%d",&idade);
  11.     if (idade>4){
  12.         switch (idade){
  13.             case 5 ... 7:
  14.                 printf("A categoria é infantil A.");
  15.             break;
  16.             case 8 ... 10:
  17.                 printf("A categoria é infantil B.");
  18.             break;
  19.             case 11 ... 13:
  20.                 printf("A categoria é juvenil A.");
  21.             break;
  22.             case 14 ... 17:
  23.                 printf("A categoria é juvenil B.");
  24.             break;
  25.             default:
  26.                 printf("A categoria é adulto.");
  27.             break;
  28.         }
  29.     }else printf("Idade insuficiente para ser um nadador.");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement