Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GCD {
- public static int f(int n){
- if(n>=101) return n-10;
- else return f(f(n+11));
- }
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- while(true){
- int n = input.nextInt();
- if(n==0) break;
- System.out.format("f91(%d)"+" = " +"%d%n", n,f(n));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement