#include <iostream>

 using namespace std;

 class Trapezium
{
private:
int x1,y1,x2,y2,x3,y3,x4,y4;
public:
void initial(){x1=,x2=;x3=;x4=;y1=;y2=;y3=;y4=;return;}
void GetPosition(int&,int&,int&,int&,int&,int&,int&,int&);
void Area()
{
double s;
s=((x2-x1)+(x4-x3))*(y2-y4)/2.0;
cout<<s<<endl;
return;
}
}; void Trapezium::GetPosition(int& a,int& b,int& c,int& d,int& e,int& f,int& g,int& h)
{
x1=a;y1=b;x2=c;y2=d;x3=e;y3=f;x4=g;y4=h;
return;
} int main()
{
int x[],y[];
Trapezium one;
for(int i=;i<;i++) cin>>x[i]>>y[i];
one.initial();
one.GetPosition(x[],y[],x[],y[],x[],y[],x[],y[]);
one.Area();
return ;
}

设计Person类 代码参考的更多相关文章

  1. 设计Dog类 代码参考

    #include <iostream> #include <string> using namespace std; class Dog { private: string n ...

  2. 设计MyTime类 代码参考

    #include <iostream> #include <cstdio> using namespace std; class MyTime { private: int h ...

  3. 设计Weekday类 代码参考

    #include <iostream> using namespace std; class Weekday { private: int num; public: void SetDay ...

  4. 设计一个多功能的MyTime类 代码参考

    #include <iostream> #include <cstdio> using namespace std; class MyTime { private: int h ...

  5. 设计带构造函数的Dog类 代码参考

    #include <iostream> #include <string> using namespace std; class Dog { private: string n ...

  6. 设计并测试Trapezium类 代码参考

    #include <iostream> using namespace std; class Trapezium { private: int x1,y1,x2,y2,x3,y3,x4,y ...

  7. 从Student类和Teacher类多重派生Graduate类 代码参考

    #include <iostream> #include <cstring> using namespace std; class Person { private: char ...

  8. 从Point类继承的Circle类 代码参考

    #include <iostream> #include <cstring> using namespace std; class Point { private: int x ...

  9. 一个基类Person的多个派生类 代码参考

    #include <iostream> #include <cstring> using namespace std; class Person { protected: ch ...

随机推荐

  1. Pika源码学习--pika的通信和线程模型

    pika的线程模型有官方的wiki介绍https://github.com/Qihoo360/pika/wiki/pika-%E7%BA%BF%E7%A8%8B%E6%A8%A1%E5%9E%8B,这 ...

  2. Ansible入门知识

    一.ansible概述 Ansible是一款为类Unix系统开发的自由开源的配置和自动化工具.它用Python写成,类似于saltstack和Puppet,但是有一个不同和优点是我们不需要在节点中安装 ...

  3. jQuery中的查找节点、创建节点、插入节点、删除节点、替换节点、复制节点操作方法

    jQuery操作节点我们可以分六点来讲,查找节点.创建节点.插入节点.删除节点.替换节点.复制节点. 一.查找节点 text() - 设置或返回所选元素的文本内容   ,html() - 设置或返回所 ...

  4. B - Save the problem! CodeForces - 867B 构造题

    B - Save the problem! CodeForces - 867B 这个题目还是很简单的,很明显是一个构造题,但是早训的时候脑子有点糊涂,想到了用1 2 来构造, 但是去算这个数的时候算错 ...

  5. B. Modulo Sum dp

    https://codeforces.com/contest/577/problem/B 先读懂题意,substring 这个是子串说明不可以跳 subsequence这个是子序列可以跳 这个题目是一 ...

  6. Java 常用API(二)

    目录 Java 常用API(二) 1. Object类 2. Date类 概述 构造方法和成员方法 3. DateFormat类 概述 SimpleDateFormat类 练习 4. Calendar ...

  7. ssm整合后打印日志查看执行sql语句

    mybatis.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configura ...

  8. 【hdu5100】棋盘覆盖

    http://acm.hdu.edu.cn/showproblem.php?pid=5100 题目大意: 用1*k的木块铺n*n的棋盘,求多铺满多少个单位格. 方法: n < k,显然无解:n ...

  9. 4-JVM 参数

    JVM 参数 标准参数:不会随着jdk版本的变化而变化.比如:java -version.java -help 非标准参数:随着JDK版本的变化而变化. -X参数[用的较少]非标准参数,也就是在JDK ...

  10. app测试、web测试-怎么测?

    app测试 前言 看过许多大神对APP测试的理解,博主总结了一下我们平时测试APP应该注意的一些测试点并结合大神的理解,总结出这篇文章. 一.测试周期 测试周期一般为两周,根据项目情况以及版本质量可适 ...