// ---------------------------------------------------------------- // PROGRAMME: Intra // AUTEUR: felipe // COMMENT: Question a l'intra de IFT1170 : Qu'affiche ce programme ? // ---------------------------------------------------------------- public class Intra { static boolean voyelle (char c) { switch (c) { case 'a': case 'e': case 'i': case 'o': case 'u': case 'y': return true; default: return false; } } static void X(String s,int i){ if (i < s.length()) { if (voyelle(s.charAt(i))) { X(s,i+1); System.out.print(s.charAt(i)); } else { System.out.print(s.charAt(i)); X(s,i+1); } } } public static void main(String [] args) { if ((args != null) && (args.length > 0)) X(args[0],0); else X("abecedaire",0); } }