UVa : 11879 (Multiple of 17)



// http://uva.onlinejudge.org/external/118/11879.html
// Runtime : 0.136s
// Tag : BigInteger


import java.math.BigInteger;

import java.util.Scanner;



public class Main {



	/**

	 * @param args

	 */

	public static void main(String[] args) {

		// TODO Auto-generated method stub

		Scanner input = new Scanner (System.in);

		BigInteger b;

		

		while ( true ) {

			b = input.nextBigInteger();

			if ( b.compareTo(BigInteger.ZERO) == 0 ) break;

			if ( b.mod(BigInteger.valueOf(17)).compareTo(BigInteger.ZERO) == 0 ) 

				System.out.println("1");

			else System.out.println ("0");

		}

	}


}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s