Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 2nd, 2014  |  syntax: Java  |  size: 0.44 KB  |  views: 66  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data