public static void main(String[] args) {
System.out.println("Tapez votre phrase !");
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
if (s.startsWith("bon")){
System.out.println("Vous avez tapé une chaine qui commence par \"bon\" ");
}
else {
System.out.println("Vous avez tapé une chaine qui ne commence pas par \"bon\" ");
}
System.out.println("Tapez votre phrase !");
Scanner sc2=new Scanner(System.in);
String s2=sc2.nextLine();
if (s2.endsWith("ir")){
System.out.println("Vous avez tapé une chaine qui se termin par \"ir\" ");
}
else {
System.out.println("Vous avez tapé une chaine qui ne se termine pas par \"ir\" ");
}
sc2.close();
Truc Informatiques
vendredi 25 mars 2016
test code
samedi 25 janvier 2014
Inscription à :
Commentaires (Atom)