//***********************************************************************
//Beschreibung	: Fibonacci MTK 1.14				    				*
//Autor			: Andreas Hauri											*
//Datum			: 10.12.02												*
//Fach			: Informatik											*
//***********************************************************************


public class Modltab
{

  	static public void main( String[] args )
  	{
		long n;
		String voiden;
		System.out.println("Bitte geben sie die Modulo Zahl ein: ");
		n = (long) InOut.getDouble();
		Addi(n);
		voiden = InOut.getLine();
		voiden = InOut.getLine();
		Multipli(n);
		voiden = InOut.getLine();
		Poten(n);


  	}
  	static public void Poten(long n)
  	{
		System.out.println("Modulare Potenz TAbelle:\n");

		System.out.print("\t");
				for(int i=0;i<n;i++)
				{System.out.print(i + "\t");
				}
				for(int i=0;i<n;i++)
				{
					System.out.println();
					System.out.print(i+"\t");
					for(int p=0;p<n;p++)
					{
						System.out.print((int)(Math.pow(p,i))%n+"\t");
					}

				}
		System.out.println();
		System.out.println("bitte um enter");
		System.out.println();
	}

	static public void Multipli(long n)
	  	{
			System.out.println("Modulare Multiplikaitons TAbelle:\n");

			System.out.print("\t");
					for(int i=0;i<n;i++)
					{System.out.print(i + "\t");
					}
					for(int i=0;i<n;i++)
					{
						System.out.println();
						System.out.print(i+"\t");
						for(int p=0;p<n;p++)
						{
							System.out.print((int)(p*i)%n+"\t");
						}

					}
			System.out.println();
			System.out.println("bitte um enter");
			System.out.println();
	}

  	static public void Addi(long n)
 	{
		System.out.println("Modulare Additions TAbelle:\n");

		System.out.print("\t");
				for(int i=0;i<n;i++)
				{System.out.print(i + "\t");
				}
				for(int i=0;i<n;i++)
				{
					System.out.println();
					System.out.print(i+"\t");
					for(int p=0;p<n;p++)
					{
						System.out.print((int)(i+p)%n+"\t");
					}

				}
		System.out.println();
		System.out.println("bitte um enter");
		System.out.println();
	}



}

