cs11_c++_lab1
lab1.cpp
#include "Point.hh"
#include <iostream>
#include <cmath> using namespace std; double computeArea(Point &a, Point &b, Point &c)
{
double x=a.distanceTo(b);
double y=b.distanceTo(c);
double z=c.distanceTo(a); double len=(x+y+z)/; double size=sqrt(len*(len-x)*(len-y)*(len-z)); return size;
}
int main()
{ Point p1;
Point p2(-,);
Point p3(,); cout<<computeArea(p1,p2,p3)<<endl; return ; }
cs11_c++_lab1的更多相关文章
- cs11_adventure c++_lab1
exercise1.cc #include <iostream> #include <vector> #include <stdlib.h> #include &l ...
- cs11_c++_lab7
wcount.cc #include <iostream> #include <map> #include <string> #include <algori ...
- cs11_c++_lab6
expressions.hh #ifndef EXPRESSIONS_HH #define EXPRESSIONS_HH #include "environment.hh" #in ...
- cs11_c++_lab5待修改
heap.hh #ifndef HEAP_HH #define HEAP_HH #include <iostream> #include <stdexcept> #includ ...
- cs11_c++_lab4b
SparseVector.hh class SparseVector { private: //结构体不一定会用到,不用初始化 struct node { int index; int value; ...
- cs11_c++_lab4a
SparseVector.hh class SparseVector { private: //结构体不一定会用到,不用初始化 struct node { int index; int value; ...
- cs11_c++_lab3
Matrix.hh class Matrix { int row; int col; int *p; void copy(const Matrix &m); void clearup(); p ...
- cs11_c++_lab2
Matrix.hh class Matrix { int row; int col; int *p; public: Matrix(); Matrix(int x,int y); ~Matrix(); ...
- goto语句引起的crosses initialization of XXX
1. 背景 goto语句虽然目前已经不提倡使用,但是用起来还是很方便,尤其是老代码中见的比较多. 在改动有goto语句的老代码时需要特别注意,是否跳过来资源的释放.有用变量的初始化等等. 很久之前写c ...
随机推荐
- Linux filesystem detection
16 down vote accepted The reason you can't find it is because, for the most part, it's not in the ke ...
- MQTT实现长连接,IM最简单实例
1,引入MqttSDK. 2, 头文件 #import "MQTTSession.h" //定义主题#define kTopic @"lichanghong"/ ...
- CheckBoxList 用法
<asp:CheckBoxList ID="cblqf" ForeColor="#4d6fc8" runat="server" Rep ...
- Python变量、数据类型6
1.Python变量 变量,即代表某个value的名字. 变量的值存储在内存中,这意味着在创建变量时会在内存中开辟一个空间. !!!即值并没有保存在变量中,它们保存在计算机内存的深处,被变量引用.所以 ...
- squid ACL 大全
Access Controls in Squid Contents Access Controls in Squid The Basics: How the parts fit together AC ...
- Elasticsearch查询
Elasticsearch支持两种类型的查询:基本查询和复合查询. 基本查询,如词条查询用于查询实际数据. 复合查询,如布尔查询,可以合并多个查询, 然而,这不是全部.除了这两种类型的查询,你还可以用 ...
- ECharts使用心得总结(二)
Echarts使用心得总结(二) 前言: 前一段时间一直都挺忙的,各种事,也没来得及每周的总结,趁着晚上的一点时间把项目中用的Echart中常用的各种图表给抽象总结了一下,趁着周末跟大家分享一下.之前 ...
- SIFT定位算法关键步骤的说明
1. SIFT算法中一些符号的说明 $I(x,y)$表示原图像. $G(x,y,\sigma)$表示高斯滤波器,其中$G(x,y,\sigma) = \frac{1}{2\pi\sigma^2}exp ...
- bzoj1513: [POI2006]Tet-Tetris 3D
Description Task: Tetris 3D "Tetris" 游戏的作者决定做一个新的游戏, 一个三维的版本, 在里面很多立方体落在平面板,一个立方体开始落下直到碰上一 ...
- POJ1229 域名匹配
给你两个域名,域名中包含一些通配符. * :匹配一个或任意多个部分 ?:匹配一个或三个部分 !:匹配三个以上部分. 求这两个域名是否能够表示同一个域名? 域名的长度不超过255. 分析:设给出的域名为 ...