1.

import java.io.IOException;
import java.util.Scanner;

/**
 * ACM Training 2009
 * ACM Problem #10219 - Find the ways!
 * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=14&problem=1160&mosmsg=Submission+received+with+ID+7365532
 *
 * @author Felix Dietrich
 * @version 1.0, 09/03/2009
 *
 * Methode: Logarithmenregeln
 * Status : Accepted
 * Runtime: 0.096
 */

public class Main
{
    public static void main(String... s) throws IOException
    {
        Scanner scan = new Scanner(System.in);
       
        while(scan.hasNext())
        {
            /////////////////////////
            // READ INFO
           
            long n = scan.nextLong();
            long k = scan.nextLong();

            if(n < k)
            {
                long t = n;
                n = k;
                k = t;
            }
           
            if(n-k > k)
                k = n-k;

            /////////////////////////
            // CALC
           
            System.out.println((long)Math.floor(logSum(k+1,n)-logSum(2,n-k))+1);
        }
    }

    private static double logSum(long start, long end)
    {
        double sum = 0;
        for(long i=start; i<=end; i++)
            sum += Math.log10(i);
       
        return sum;
    }
}

2.

//package p2;
import java.io.IOException;
import java.math.BigInteger;
import java.util.Scanner;

/**
 * ACM Training 2009
 * ACM Problem #10219 - Find the ways!
 * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=14&problem=1160&mosmsg=Submission+received+with+ID+7365532
 *
 * @author Felix Dietrich
 * @version 1.0, 09/03/2009
 *
 * Methode: BigInteger
 * Status : Accepted
 * Runtime: 0.096
 */

public class Main
{
    public static void main(String... s) throws IOException
    {
        Scanner scan = new Scanner(System.in);
       
        while(scan.hasNext())
        {
            /////////////////////////
            // READ INFO
           
            long n = scan.nextLong();
            long k = scan.nextLong();

            if(n < k)
            {
                long t = n;
                n = k;
                k = t;
            }
           
            if(n-k > k)
                k = n-k;

            /////////////////////////
            // CALC
           
            BigInteger nominator = BigInteger.valueOf(1);
            for(long i=k+1; i<=n;i++)
                nominator = nominator.multiply(BigInteger.valueOf(i));
           
            BigInteger denominator = BigInteger.valueOf(1);
            for(long i=2; i<=n-k;i++)
                denominator = denominator.multiply(BigInteger.valueOf(i));
           
            System.out.println(nominator.divide(denominator).toString().length());
        }
    }

    private static double logSum(long start, long end)
    {
        double sum = 0;
        for(long i=start; i<=end; i++)
            sum += Math.log10(i);
       
        return sum;
    }
}

3.

/**
* ACM programming Contest
* UVa Status: Accepted
* Run Time: 0.000
* Programming Language: C
* @author Doina Logofatu logofatu@hm.edu
*/

/*
Anzahl der Ziffern der Zahl N ist: floor(log10(N)) + 1
Allgemein: log10(AB) = log10(A) + log10(B), log10(A/B) = log10(A) - log10(B)
Man schreibt die log10(Kombinationen-Formel) mit Hilfe der Addition & Substraktion
*/

#include <stdio.h>
#include <math.h>

int main() {

unsigned long long n, k;
unsigned long long i;
register double s;

while(scanf("%llu %llu", &n, &k) == 2){
s = 0;
if(k>n-k) k=n-k;
for (i=1; i<k; i++) s -= log10(i+1);
for (i=0; i<k; i++) s += log10(n-i);
printf("%d\n", (int)floor(s)+1);
}

return 0;
}