[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
实验三 牛顿插值多项式
实验内容:天安门广场升旗的时间是日出的时刻,而降旗的时间是日落时分,根据天安门广场管理委员会的公告,某年10月份升降旗的时间如下:
日期 1 15 22
升旗 6:09 6:23 6:31
降旗 17:58 17:36 17:26
根据上述数据构造Newton插值多项式,计算当年10月8日北京市的日照时长。
```c #include<stdio.h> #include<math.h> #define n 3 void main() { int
i,j,X=8,x[n]={1,15,22}; float
y[n]={17-6+(58-9)/60.0,17-6+(36-23)/60.0,17-6+(26-31)/60.0},
time=0.0,z[n][n];//z里面存储的是差商值 for(i=0;i<n;i++)//完成了0阶差商的赋值 z[i][0]=y[i];
for(j=1;j<n;j++)//j是控制我们计算几阶差商的,如果看成是二维数组的列号也可以
for(i=j;i<n;i++)//i只需要计算对角线下面的,也就是i>j的情况 z[i][j]=( ); //这个就是我们转换到数组后差商的计算公式
time=( ); //time里面就是我们最后的结果,它的形式就是newton插值多项式
printf("10月8号的日照时长为:%d小时%.0f分钟\n", (int)floor(time),60*fmod(time,1.0)); }