Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class GCD {
  8.  
  9.     public static int f(int n){
  10.         if(n>=101) return n-10;
  11.         else  return f(f(n+11));
  12.     }
  13.  
  14.     public static void main(String[] args) {
  15.         Scanner input = new Scanner(System.in);
  16.         while(true){
  17.             int n = input.nextInt();
  18.             if(n==0) break;
  19.             System.out.format("f91(%d)"+" = " +"%d%n", n,f(n));
  20.        
  21.         }
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement