#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. mysql-case..when知识点总结

    case...when..有两种语法: 第一种: case  case_value when when_value  then statement_list [when when_value  the ...

  2. Java——HTTP超详细总结

    HTTP协议概述 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文本到本地浏览器的 ...

  3. 基于OpenCV的KNN算法实现手写数字识别

    基于OpenCV的KNN算法实现手写数字识别 一.数据预处理 # 导入所需模块 import cv2 import numpy as np import matplotlib.pyplot as pl ...

  4. 软件工程复习 WHUT

    软件过程模型: 瀑布模型:界限分明的独立阶段,计划驱动的软件过程.规范软件开发活动 (例如:可分为分析.开发.维护三个阶段) 也称生命周期模型.线性模型,采用结构化分析.设计.编程技术 不足的地方:知 ...

  5. 多线程实践—Python多线程编程

    多线程实践 前面的一些文章和脚本都是只能做学习多线程的原理使用,实际上什么有用的事情也没有做.接下来进行多线程的实践,看一看在实际项目中是怎么使用多线程的. 图书排名示例 Bookrank.py: 该 ...

  6. [linux] VNC the connection was refused by the computer

    在用VNC 连接host的时候发现“”“the connection was refused by the computer ” 方法:发现登录这个host,敲打:verser 的时候出现了这个: 它 ...

  7. Python中内置函数

    python提供了很多的内置函数,这些内置的函数在某些情况下,可以起到很大的作用,而不需要专门去 写函数实现XX功能,直接使用内置函数就可以实现,下面分别来学习内置函数的使用和案例代码. abs(), ...

  8. Python list列表修改元素

    Python 提供了两种修改列表(list)元素的方法,你可以每次修改单个元素,也可以每次修改一组元素(多个). 修改单个元素 修改单个元素非常简单,直接对元素赋值即可.请看下面的例子: nums = ...

  9. SpringBoot整合Redis实现简单的set、get

    一.导入pom.xml文件相关的依赖并配置 <dependency> <groupId>org.springframework.boot</groupId> < ...

  10. Bootstrap组件的使用

    五.常用组件 总结: boot中事件,关注两件事 1.事件是如何触发的.自定义属性触发,触发方式是这个属性的值 2.事件触发的目标 button绑定目标 data-target="#id&q ...