Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Lista de Exercícios - 18
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int idade;
- printf("Entre com a idade do nadador: ");
- scanf("%d",&idade);
- if (idade>4){
- switch (idade){
- case 5 ... 7:
- printf("A categoria é infantil A.");
- break;
- case 8 ... 10:
- printf("A categoria é infantil B.");
- break;
- case 11 ... 13:
- printf("A categoria é juvenil A.");
- break;
- case 14 ... 17:
- printf("A categoria é juvenil B.");
- break;
- default:
- printf("A categoria é adulto.");
- break;
- }
- }else printf("Idade insuficiente para ser um nadador.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement