Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.app;
- public class ExampleApp {
- public static void main(String[] args){
- int n;
- Scanner in = new Scanner(System.in);
- n = in.read();
- System.out.println(myFunc(n));
- }
- public String myFunc(int border) {
- int temp = 0;
- String s = "";
- if (temp<border){
- s = s + temp.toString() + " ";
- myFunc(temp+1);
- } elseif (temp==border) {
- return s;
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement