1.

/**
* Angewandte Mathematik, SS11
* Problem: 10106 Product
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1047
* @author Brielbeck, Daniel
* @author Weber, Georg
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.112
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {

public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String input;
String input2;
BigInteger output = new BigInteger("0");
while ((input = reader.readLine()) != null) {
if (input.equals("0")) break;
input2= reader.readLine();
BigInteger temp = new BigInteger(input);
System.out.println(temp.multiply(new BigInteger(input2)));

}
}

}

2.

/**
* Angewandte Mathematik, SS11
* Problem: 10106 - Product
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Fabian Trampusch
* @author Robert Schwarz
* @version 1.0, 16.04.2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.128
*/
import java.io.*;
import java.math.BigInteger;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

BigInteger firstNum, secondNum;
String input;

try {
while (true) {
input = br.readLine();
firstNum = new BigInteger(input);

input = br.readLine();
secondNum = new BigInteger(input);

System.out.println(firstNum.multiply(secondNum));
}
} catch (Exception e) {

}
}
}

3.

/**
* Angewandte Mathematik, SS11
* Problem: 10106 - Product
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.128
*/


import java.math.*;
import java.util.*;

public class Main {

public static void main(String[] args) {
BigInteger number1;
BigInteger number2;

Scanner input = new Scanner(System.in);

while(input.hasNext()){
number1 = input.nextBigInteger();
number2 = input.nextBigInteger();
System.out.println(number1.multiply(number2));
}
}
}
4.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

/**
* Angewandte Mathematik, SS11
* Problem: 10106 - Product
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 11/4/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.108
*/

public class Main {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
while((inputLine = reader.readLine())!=null)
{
BigInteger x = new BigInteger(inputLine);
if((inputLine = reader.readLine())==null) break;
BigInteger y = new BigInteger(inputLine);
System.out.println(x.multiply(y));
}
}
}


------------------------------------------------
1.


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 10106 Product
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Anton Pavlushko, IBB7B,
* @version 1.0, 10/10/2010
*
* Status : Accepted
* Runtime: 0.436
*/

import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String current_line2, current_line, empty = "";
int number, factorial, i, j, length, number_local, length_1, length_2, k;
int primes [], counts [], current_multiply;
double znak,count5,count5_already,multiply;
StringTokenizer input_string;
boolean status, at_least_one;
int first[], second[], result[];

try {
while ((current_line=in.readLine())!= null && !current_line.equals("0") &&
(current_line2=in.readLine())!= null) {
current_line=current_line.trim();
current_line2=current_line2.trim();

first = new int[251];
second = new int[251];
result = new int[502];

length_1=current_line2.length();
for(i=length_1-1;i>=0;i--) {
second[length_1-i] = Integer.parseInt(current_line2.substring(i,i+1));
}

length_2=current_line.length();
for(i=length_2-1;i>=0;i--) {
first[length_2-i] = Integer.parseInt(current_line.substring(i,i+1));
}

if (!current_line.equals("0") && !current_line2.equals("0"))
for(i=1;i<=length_1;i++) {

for(j=1;j<=length_2;j++) {
k=first[j]*second[i];

result[i+j-1]+=k%10;
result[i+j]+=k/10;

length=result.length;

do {
number=0;
for(k=0;k<length;k++) {
if (result[k]>=10) {
result[k+1]+=result[k]/10;
result[k]=result[k]%10;
number++;
}
}
} while (number>0);
}
}

length=result.length;
empty="";
status=false;
for(i=length-1;i>0;i--) {
if (result[i]>0) status=true;
if (status) empty=empty+result[i];
}

if (current_line.equals("0") || current_line2.equals("0"))
System.out.println("0");
else
System.out.println(empty);
} // end while
} // end try
catch (IOException e) {
System.err.println("Error: " + e);
}
}
}


2.

/**
* ACM Training 2010
* ACM Problem #10106 - Product
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=13&problem=1047&mosmsg=Submission+received+with+ID+7886373
*
* @author Felix Dietrich
* @version 1.0, 04/09/2010
*
* Methode: BigInteger
* Status : Accepted
* Runtime: 0.144
*/

import java.math.BigInteger;
import java.util.*;

public class Main
{
public static void main(String... strs)
{
Scanner sc = new Scanner(System.in);

while(sc.hasNext())
{
BigInteger s1 = new BigInteger(sc.next());
BigInteger s2 = new BigInteger(sc.next());

System.out.println(s1.multiply(s2).toString());
}
}
}