import java.io.*;

class H2YOEx5
{
   public static double exp(double x)
   {
   //===exponensiyeli hesaplayan statik metod	
   double faktoriyel=1;
   double us=1;
   double exponent=1;
   for(double sayi=1;sayi<=200;sayi++)
   {
   faktoriyel*=sayi;
   us*=x;
   exponent+=us/faktoriyel;
   }
   return exponent;
   }
   //====kareyi hesaplayan statik metod
   public static double kare(double x)
   {return x*x;}
//====main statik metodu
public static void main(String args[]) throws IOException
{
BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
double x;
System.out.print("Bir sayi giriniz:");
x=Double.parseDouble(cin.readLine());
System.out.println("exp("+x+") = "+exp(x));
System.out.println("Java kutuphanesindeki metodu kullanirsak : ");
System.out.println("exp("+x+") = "+Math.exp(x));
System.out.println("kare metodu : ");
System.out.println("kare("+x+") = "+kare(x));
}
}