public class Mianji
{
static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
System.out.println("enter:triangle-1,rectangle-2");
int form = sc.nextInt();
calArea(form);
}
public static void calArea(int form){
switch(form)
{
case 1:
System.out.println("Enter bash:");
double bottom = sc.nextDouble();
System.out.println("Enter hight:");
double height = sc.nextDouble();
System.out.println("triangle:"+bottomheight/2);
break;
case 2:
System.out.println("Enter juxingde width:");
double bottom1 = sc.nextDouble();
System.out.println("Enter juxingde hight");
double width = sc.nextDouble();
System.out.println("juxingdemianjishi:"+bottom1width);
break;
}
}