import java.io.*; class trapez { public static void main(String args[]) { int b; int B,h; double A,P,z; b=citeste.intreg("\nIntroduceti baza mica b="); B=citeste.intreg("\nIntroduceti baza mare B="); h=citeste.intreg("\nIntroduceti inaltimea h="); if(b<0 || B<0 || h<0) { System.out.println("Valori gresite!!!"); } else { z=Math.sqrt(((B-b)/2)*((B-b)/2)+h*h); P=b+B+2*z; A=b*h+2*(h*((B-b)/2)/2); System.out.println(" P=" + P); System.out.println(" A=" + A); } } } class citeste { public static int intreg(String text) { byte b; byte []a= new byte[81]; int i=0,z; System.out.print(text); try { while((b=(byte)System.in.read())!='\n') { a[i++]=b; } }catch(IOException e) {e.printStackTrace();} z=Integer.parseInt(new String(a,0,(i-1))); return z; } }