7th_B

本文介绍了一个使用C++实现的简单数值积分程序。该程序通过输入多项式的系数、积分上下限及项数,能够计算出多项式在指定区间内的积分值。主要涉及C++基本语法、文件操作以及简单的数学计算。

#include<cstdio>
double mul(double x,int y){
double result=1.0;
for(int i=0;i<y;i++){
result*=x;
}
return result;
}
int main(){
int n=0;
double A=0,B=0;
double a[11];
double res_A;
double res_B;
scanf("%d%lf%lf",&n,&A,&B);
for(int i=0;i<n+1;i++){
scanf("%lf",&(a[i]));
double temp=a[i]/(i+1);
res_A+=temp*mul(A,i+1);
res_B+=temp*mul(B,i+1);
}
int result = (int)(res_B-res_A+0.5);
printf("%d\n",result);
return 0;
}
你现在帮我计算fpd1_lift 区分首复贷和产品 就是分子:区间逾期的样本/区间所有样本 分母:所有逾期样本/总样本 分十个箱 表名为dws.dws_acct_triangle_df 表的内容有:contr_no apply_no apply_date 1st_loan_date 1st_wdraw_date 1st_consume_date loan_tot_amt wdraw_tot_amt consume_tot_amt spl_tot_prin spl_tot_debt dpd max_dpd 1st_repayable_date 1st_cleared_date 1st_dpd 2nd_repayable_date 2nd_cleared_date 2nd_dpd 3rd_repayable_date 3rd_cleared_date 3rd_dpd 4th_repayable_date 4th_cleared_date 4th_dpd 5th_repayable_date 5th_cleared_date 5th_dpd 6th_repayable_date 6th_cleared_date 6th_dpd 7th_repayable_date 7th_cleared_date 7th_dpd 8th_repayable_date 8th_cleared_date 8th_dpd 9th_repayable_date 9th_cleared_date 9th_dpd 10th_repayable_date 10th_cleared_date 10th_dpd 11th_repayable_date 11th_cleared_date 11th_dpd 12th_repayable_date 12th_cleared_date 12th_dpd 13th_repayable_date 13th_cleared_date 13th_dpd 14th_repayable_date 14th_cleared_date 14th_dpd 15th_repayable_date 15th_cleared_date 15th_dpd 16th_repayable_date 16th_cleared_date 16th_dpd 17th_repayable_date 17th_cleared_date 17th_dpd 18th_repayable_date 18th_cleared_date 18th_dpd 19th_repayable_date 19th_cleared_date 19th_dpd 20th_repayable_date 20th_cleared_date 20th_dpd 21th_repayable_date 21th_cleared_date 21th_dpd 22th_repayable_date 22th_cleared_date 22th_dpd 23th_repayable_date 23th_cleared_date 23th_dpd 24th_repayable_date 24th_cleared_date 24th_dpd lately_24th_repayable_date lately_24th_cleared_date lately_24th_dpd lately_23th_repayable_date lately_23th_cleared_date lately_23th_dpd lately_22th_repayable_date lately_22th_cleared_date lately_22th_dpd lately_21th_repayable_date lately_21th_cleared_date lately_21th_dpd lately_20th_repayable_date lately_20th_cleared_date lately_20th_dpd lately_19th_repayable_date lately_19th_cleared_date lately_19th_dpd lately_18th_repayable_date lately_18th_cleared_date lately_18th_dpd lately_17th_repayable_date lately_17th_cleared_date lately_17th_dpd lately_16th_repayable_date lately_16th_cleared_date lately_16th_dpd lately_15th_repayable_date lately_15th_cleared_date lately_15th_dpd lately_14th_repayable_date lately_14th_cleared_date lately_14th_dpd lately_13th_repayable_date lately_13th_cleared_date lately_13th_dpd lately_12th_repayable_date lately_12th_cleared_date lately_12th_dpd lately_11th_repayable_date lately_11th_cleared_date lately_11th_dpd lately_10th_repayable_date lately_10th_cleared_date lately_10th_dpd lately_9th_repayable_date lately_9th_cleared_date lately_9th_dpd lately_8th_repayable_date lately_8th_cleared_date lately_8th_dpd lately_7th_repayable_date lately_7th_cleared_date lately_7th_dpd lately_6th_repayable_date lately_6th_cleared_date lately_6th_dpd lately_5th_repayable_date lately_5th_cleared_date lately_5th_dpd lately_4th_repayable_date lately_4th_cleared_date lately_4th_dpd lately_3rd_repayable_date lately_3rd_cleared_date lately_3rd_dpd lately_2nd_repayable_date lately_2nd_cleared_date lately_2nd_dpd lately_1st_repayable_date lately_1st_cleared_date lately_1st_dpd etl_time etl_source unique_id master_contr_no master_child_contr_flag prod_cd ovd_begin_date cpd_begin_date repayable_prin repay_match_prin_amt ovd_prin dt
08-07
你现在帮我计算fpd1_lift 区分首复贷和产品 计算fpd1的时候要这样计算: SELECT prod_cd, COUNT(DISTINCT contr_no) AS total_loans, SUM(CASE WHEN 1st_dpd >= 1 THEN 1 ELSE 0 END) AS fpd1_count, SUM(CASE WHEN 1st_dpd >= 7 THEN 1 ELSE 0 END) AS fpd7_count, SUM(CASE WHEN 1st_dpd >= 15 THEN 1 ELSE 0 END) AS fpd15_count, SUM(CASE WHEN 1st_dpd >= 30 THEN 1 ELSE 0 END) AS fpd30_count, ROUND(SUM(CASE WHEN 1st_dpd >= 1 THEN 1 ELSE 0 END) / COUNT(DISTINCT contr_no), 4) AS fpd1, ROUND(SUM(CASE WHEN 1st_dpd >= 7 THEN 1 ELSE 0 END) / COUNT(DISTINCT contr_no), 4) AS fpd7, ROUND(SUM(CASE WHEN 1st_dpd >= 15 THEN 1 ELSE 0 END) / COUNT(DISTINCT contr_no), 4) AS fpd15, ROUND(SUM(CASE WHEN 1st_dpd >= 30 THEN 1 ELSE 0 END) / COUNT(DISTINCT contr_no), 4) AS fpd30 FROM dws.dws_acct_triangle_df WHERE dt = '20250802' AND DATEDIFF(TO_DATE(dt, 'yyyyMMdd'), 1st_loan_date) >= 1 AND ( (1st_dpd >= 1 AND DATEDIFF(TO_DATE(dt, 'yyyyMMdd'), 1st_loan_date) >= 1) OR (1st_dpd >= 7 AND DATEDIFF(TO_DATE(dt, 'yyyyMMdd'), 1st_loan_date) >= 7) OR (1st_dpd >= 15 AND DATEDIFF(TO_DATE(dt, 'yyyyMMdd'), 1st_loan_date) >= 15) OR (1st_dpd >= 30 AND DATEDIFF(TO_DATE(dt, 'yyyyMMdd'), 1st_loan_date) >= 30) OR 1st_dpd IS NULL OR 1st_dpd = 0 ) GROUP BY prod_cd; 最终计算fpd1lift的计算方法:分子:区间逾期的样本/区间所有样本 分母:所有逾期样本/总样本 分十个箱 表名为dws.dws_acct_triangle_df 表的内容有:contr_no apply_no apply_date 1st_loan_date 1st_wdraw_date 1st_consume_date loan_tot_amt wdraw_tot_amt consume_tot_amt spl_tot_prin spl_tot_debt dpd max_dpd 1st_repayable_date 1st_cleared_date 1st_dpd 2nd_repayable_date 2nd_cleared_date 2nd_dpd 3rd_repayable_date 3rd_cleared_date 3rd_dpd 4th_repayable_date 4th_cleared_date 4th_dpd 5th_repayable_date 5th_cleared_date 5th_dpd 6th_repayable_date 6th_cleared_date 6th_dpd 7th_repayable_date 7th_cleared_date 7th_dpd 8th_repayable_date 8th_cleared_date 8th_dpd 9th_repayable_date 9th_cleared_date 9th_dpd 10th_repayable_date 10th_cleared_date 10th_dpd 11th_repayable_date 11th_cleared_date 11th_dpd 12th_repayable_date 12th_cleared_date 12th_dpd 13th_repayable_date 13th_cleared_date 13th_dpd 14th_repayable_date 14th_cleared_date 14th_dpd 15th_repayable_date 15th_cleared_date 15th_dpd 16th_repayable_date 16th_cleared_date 16th_dpd 17th_repayable_date 17th_cleared_date 17th_dpd 18th_repayable_date 18th_cleared_date 18th_dpd 19th_repayable_date 19th_cleared_date 19th_dpd 20th_repayable_date 20th_cleared_date 20th_dpd 21th_repayable_date 21th_cleared_date 21th_dpd 22th_repayable_date 22th_cleared_date 22th_dpd 23th_repayable_date 23th_cleared_date 23th_dpd 24th_repayable_date 24th_cleared_date 24th_dpd lately_24th_repayable_date lately_24th_cleared_date lately_24th_dpd lately_23th_repayable_date lately_23th_cleared_date lately_23th_dpd lately_22th_repayable_date lately_22th_cleared_date lately_22th_dpd lately_21th_repayable_date lately_21th_cleared_date lately_21th_dpd lately_20th_repayable_date lately_20th_cleared_date lately_20th_dpd lately_19th_repayable_date lately_19th_cleared_date lately_19th_dpd lately_18th_repayable_date lately_18th_cleared_date lately_18th_dpd lately_17th_repayable_date lately_17th_cleared_date lately_17th_dpd lately_16th_repayable_date lately_16th_cleared_date lately_16th_dpd lately_15th_repayable_date lately_15th_cleared_date lately_15th_dpd lately_14th_repayable_date lately_14th_cleared_date lately_14th_dpd lately_13th_repayable_date lately_13th_cleared_date lately_13th_dpd lately_12th_repayable_date lately_12th_cleared_date lately_12th_dpd lately_11th_repayable_date lately_11th_cleared_date lately_11th_dpd lately_10th_repayable_date lately_10th_cleared_date lately_10th_dpd lately_9th_repayable_date lately_9th_cleared_date lately_9th_dpd lately_8th_repayable_date lately_8th_cleared_date lately_8th_dpd lately_7th_repayable_date lately_7th_cleared_date lately_7th_dpd lately_6th_repayable_date lately_6th_cleared_date lately_6th_dpd lately_5th_repayable_date lately_5th_cleared_date lately_5th_dpd lately_4th_repayable_date lately_4th_cleared_date lately_4th_dpd lately_3rd_repayable_date lately_3rd_cleared_date lately_3rd_dpd lately_2nd_repayable_date lately_2nd_cleared_date lately_2nd_dpd lately_1st_repayable_date lately_1st_cleared_date lately_1st_dpd etl_time etl_source unique_id master_contr_no master_child_contr_flag prod_cd ovd_begin_date cpd_begin_date repayable_prin repay_match_prin_amt ovd_prin dt
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值