Skip to content

Instantly share code, notes, and snippets.

@FernandaBernardo
Created March 23, 2013 02:59
Show Gist options
  • Save FernandaBernardo/5226231 to your computer and use it in GitHub Desktop.
Save FernandaBernardo/5226231 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
class Meses {
public static void main (String[] args){
Scanner sc = new Scanner (System.in);
System.out.println ("Digite um numero");
int mes = sc.nextInt ();
switch (mes) {
case 1:
System.out.println("Seu mes eh janeiro");
break ;
case 2:
System.out.println("Seu mes eh fevereiro");
break;
case 3:
System.out.println("Seu mes eh marco");
break ;
case 4:
System.out.println("Seu mes eh abril");
break ;
case 5:
System.out.println("Seu mes eh maio");
break ;
case 6:
System.out.println("Seu mes eh junho");
break ;
case 7:
System.out.println("Seu mes eh julho");
break ;
case 8:
System.out.println("Seu mes eh agosto");
break;
case 9:
System.out.println("Seu mes eh setembro");
break ;
case 10:
System.out.println("Seu mes eh outubro ");
break ;
case 11:
System.out.println("Seu mes eh novembro");
break ;
case 12:
System.out.println("Seu mes eh dezembro");
break ;
default:
System.out.println("Um ano soh 12 meses seu animal");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment