Author : Jisan
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-10055
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996
Help: http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
Code:
import java.math.BigInteger;
import java.util.Scanner;
public class Uva_10055 {
public static void main(String args[]){
Scanner J=new Scanner(System.in);
BigInteger Big;
while(J.hasNext()){
BigInteger a=new BigInteger (J.next());
BigInteger b=new BigInteger (J.next());
if(a.compareTo(b)>0){
Big=a.subtract(b);
}else{
Big=b.subtract(a);
}
System.out.println(Big);
}
}
}
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-10055
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996
Help: http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
Code:
import java.math.BigInteger;
import java.util.Scanner;
public class Uva_10055 {
public static void main(String args[]){
Scanner J=new Scanner(System.in);
BigInteger Big;
while(J.hasNext()){
BigInteger a=new BigInteger (J.next());
BigInteger b=new BigInteger (J.next());
if(a.compareTo(b)>0){
Big=a.subtract(b);
}else{
Big=b.subtract(a);
}
System.out.println(Big);
}
}
}
No comments:
Post a Comment