Advertisement
Guest User

TemporaryProblem

a guest
Apr 9th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package com.example.app;
  2.  
  3. public class ExampleApp {
  4.  
  5.     public static void main(String[] args){
  6.         int n;
  7.         Scanner in = new Scanner(System.in);
  8.         n = in.read();
  9.         System.out.println(myFunc(n));
  10.     }
  11.  
  12.     public String myFunc(int border) {
  13.         int temp = 0;
  14.         String s = "";
  15.         if (temp<border){
  16.             s = s + temp.toString() + " ";
  17.             myFunc(temp+1);
  18.         } elseif (temp==border) {
  19.             return s;
  20.         }
  21.         return null;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement