Cap4 8
public class cap4_8
{
    public static void countdown (int n) {
        if (n == 0) {
                System.out.println("Blastoff!");
        } else {
                System.out.println(n);
                countdown(n-1);
          }
    }
 
    public static void nLines (int n) {
        if (n > 0) {
                System.out.println("");
                nLines(n-1);
          }
    }
 
    public static void main(String [] args) {
        int x = 5;
        countdown(x);
        nLines(x);
    }
}

voltar

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.