博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 1071 The area ——微积分
阅读量:6979 次
发布时间:2019-06-27

本文共 1027 字,大约阅读时间需要 3 分钟。

【题目分析】

    求二次函数和一次函数围成的面积。

    先解方程求出一次函数和二次函数。

    然后积分。

    现在还是不会积分。

【代码】

#include 
#include
#include
//#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;#define maxn 20005#define mlog 16#define inf (0x3f3f3f3f)void Finout(){ #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin);// freopen("out.txt","w",stdout); #endif} int Getint(){ int x=0,f=1; char ch=getchar(); while (ch<'0'||ch>'9') {if (ch=='-') f=-1; ch=getchar();} while (ch>='0'&&ch<='9') {x=x*10+ch-'0'; ch=getchar();} return x*f;}int T;double x1,x2,x3,y1,y2,y3;double a,b,c,t,k;int main(){ Finout(); T=Getint(); while (T--) { scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3); k=(y3-y2)/(x3-x2); t=y3-x3*k; a=(y2-y1)/((x1-x2)*(x1-x2)); b=-x1*2*a; c=y1-a*x1*x1-b*x1; printf("%.2f\n",(a/3*x3*x3*x3+(b-k)/2*x3*x3+x3*(c-t))-(a/3*x2*x2*x2+(b-k)/2*x2*x2+x2*(c-t))); }}

  

转载于:https://www.cnblogs.com/SfailSth/p/6360264.html

你可能感兴趣的文章
海量数据处理
查看>>
Linux下二进制文件安装MySQL
查看>>
J2EE开源项目
查看>>
phpstudy多站点配置好后index of/ 列表无法出现的解决
查看>>
70.打印所有Spring boot载入的bean【从零开始学Spring Boot】
查看>>
jvm compile
查看>>
linux内核SMP负载均衡浅析
查看>>
display的block、none、inline属性及解释
查看>>
新的Mac下如何配置开发者账号信息
查看>>
非阻塞socket的连接
查看>>
UITextField的代理方法
查看>>
无人驾驶相关数据集
查看>>
C 的大致运行原理。
查看>>
关于jsp和eclipse服务器端的相关配置和JS的区别
查看>>
JavaScript - 数据类型和变量
查看>>
TCP/IP:IP选项处理
查看>>
【网摘】检测 iframe 是否加载完成
查看>>
cocos2dx 3.x(动态改变精灵的背景图片)
查看>>
cocos2d-x JS 获取当前系统时间(解决屏幕双击点击事件)
查看>>
支付宝接入参考博客
查看>>