Chinaunix首页 | 论坛 | 博客
  • 博客访问: 22320
  • 博文数量: 69
  • 博客积分: 1545
  • 博客等级: 上尉
  • 技术积分: 735
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-03 14:17
个人简介

fdsfdsfdsfds

文章分类

全部博文(69)

文章存档

2014年(8)

2012年(61)

我的朋友

分类: Java

2012-04-06 16:41:55

import java.util.*;
public class Main {
  public static void main(String args[]){
 Scanner cin=new Scanner(System.in);
 
 Double result=0.00d;
  while(true){
    Double x0= cin.nextDouble();    
    Double y0= cin.nextDouble();   
    Double x1= cin.nextDouble();   
    Double y1= cin.nextDouble();   
    Double x2= cin.nextDouble();   
    Double y2= cin.nextDouble();
    if(x0 y0 x1 y1 x2 y2==0) break;
    result = ((x1-x0)*(y2-y0)-(x2-x0)*(y1-y0))/2;
    result=Math.abs(result);
     
      java.text.DecimalFormat myformat=new java.text.DecimalFormat("0.0");

      String str = myformat.format(result);    
    System.out.println(str);
 
   }
 
  }
  
}

 
#include
#include
int main()
{
  int a,b,c,d,e,r,s;
  while(1)
  {
 scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&r);
 if(a==0&&b==0&&c==0&&d==0&&e==0&&r==0)   return 0;
   s=(a*d+b*e+c*r)-(a*r+d*e+b*c);
  if(s<0)   s=-s;
    printf("%.1f\n",s/2.0);
  
  }return 0;
}        
阅读(156) | 评论(0) | 转发(0) |
0

上一篇:hdu 53

下一篇:hdu 50 水题

给主人留下些什么吧!~~