BlueEyes and Apples (I)

时间:2014-01-23 07:57:51   收藏:0   阅读:460

http://cstest.scu.edu.cn/soj/problem.action?id=1074

//package bo_jwolf;
import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner cin = new Scanner( new BufferedInputStream( System.in ) );
		while( true ){
			BigInteger a, b, c;
			a = cin.nextBigInteger();
			b = cin.nextBigInteger();
			if(  a.equals( BigInteger.ZERO ) && b.equals( BigInteger.ZERO ) )
				break;
			c = a.subtract( b );
			if( a.compareTo( b ) == 0 ){
				System.out.print( "well done!\n" );
			}
			else if( a.compareTo( b ) > 0 ){
				System.out.print( c );
				System.out.print( "\n" );
			}
			else
				System.out.print( "are you crazy?\n" );
		}
	}

}


原文:http://blog.csdn.net/bo_jwolf/article/details/18676993

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!