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 ...
随机推荐
- C#中this在扩展方法的应用
给类添加扩展方法 1.定义一个类Service public class Service { private string _name; public string Name { get { retu ...
- 三部曲二(基本算法、动态规划、搜索)-1006-The Same Game
The Same Game Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4585 Accepted: 1699 Des ...
- eclipse生成doc文件乱码
正确生成:在所写项目右击----Export----Java----javadoc---next ----一直next---finish. 乱码时:1)右击----Export----Java---- ...
- bs结构socket(udp)通信
以前我所做的基于socket通信都是采用cs结构,现公司有一个项目需要在bs中反控设备,于是研究了一番,现将成果公布,方便以后查阅. 服务端: #region udp int recv; byte[] ...
- Timer和TimerTask的用法
最近在做java课程设计的时候,我用到了timer,于是学习了一下timer的用法. java实现多线程比较常用的两种方法,一种是直接继承Thread类,另一种则是实现Runnable接口.Timer ...
- vim编辑器使用相关
alias 查看vi是否已经绑定vim 一.vim的块选择 v 字符选择 V 行选择 ctrl+v 快选择 y 复制选择的地方(p进行粘贴) d 删除选择的地方 二.vim多文件编辑 :n 编辑下一个 ...
- 一:解决VirtualBox只能安装32位系统的问题
发现自己的笔记本(Thinkpad E440)里的 VirtualBox 只能安装 32位 的系统,如下图所示: 经过一番查资料,发现这玩意需要到BIOS里设置一下,方可安装 64位 系统,操作如下: ...
- RestEasy 3.x 系列之一:Hello world
RestEasy 3.x改了不少,走了好多弯路才终于搞出来,做做笔记,陆续发布…… tomcat-7.0.50 java version "1.7.0_51" myeclipse ...
- 高效Web开发的10个jQuery代码片段(10 JQUERY SNIPPETS FOR EFFICIENT WEB DEVELOPMENT)
在过去的几年中,jQuery一直是使用最为广泛的JavaScript脚本库.今天我们将为各位Web开发者提供10个最实用的jQuery代码片段,有需要的开发者可以保存起来. 1.检测Internet ...
- VSFTP服务器
vsftpd 是"very secure FTP daemon"的缩写,安全性是它的一个最大的特点.vsftpd 是一个 UNIX 类操作系统上运行的服务器的名字,它可以运行在诸如 ...