Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class min_ricorsivo {
- public static int min (int n, int i){
- Display.print("Input " + i++ + " : ");
- int r = Keyboard.readInteger();
- if(n==0)
- n=r;
- if(r!=0){
- if(r<n)
- n = r;
- n = min(n, i);
- }
- return n;
- }
- public static void main(String[] args){
- int n = min(0, 1);
- Display.println("Il numero minore e': " + n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment