gravatar

T1065-求助大佬,答案匹配但是wa

张鑫来蔡宇姣 at 2018-11-22T11:09:46+00:00 Go TO Problem T1065

<!--Markdown--> 1. 1. #include <stdio.h> #include <math.h> void myprintf(double c,double b,double a,double d)//进行打印 { if(((int)(a*1000))%10 == 0)//判断位数输出rate if(((int)(a*100))%10 != 0) printf("%.2f\t\t",a); else printf("%.1f\t\t",a); else printf("%.3f\t\t",a); if(((int)(c*100))%10)//判断位数输出月money printf("%.2f\t\t",c); else printf("%.1f\t\t",c); if(((int)(b*100))%10)//判断位数输出年money printf("%.2f",b); else printf("%.1f",b); if(a != d)//判断输出换行。最后一行不输出 printf("\n"); } int main() { double money, year,a,b; scanf("%lf%lf%lf%lf",&money,&year,&a,&b); const double x = 0.125; printf("Interest Rate\tMonthly Payment\tTotal Payment\n");//输出标题 for(;a <= b;a+=x) { double rate = a/1200; double s_money = ((int)((money*rate)/(1-1/pow(1+rate,12*year))*100))/100.0; double year_money = ((int)((money*rate)/(1-1/pow(1+rate,12*year))*100*12*year))/100.0; myprintf( s_money, year_money, a,b); } return 0; }

Comments:

gravatar wxx_acm
2022-09-09T09:34:52+00:00
<!--Markdown-->
Reply:
gravatar wxx_acm to wxx_acm at 2022-09-09T09:35:07+00:00
<!--Markdown--> 123
gravatar wxx_acm to wxx_acm at 2022-09-09T09:35:16+00:00
<!--Markdown--> 123123
gravatar wxx_acm to wxx_acm at 2022-09-09T09:36:22+00:00
<!--Markdown--> 阿萨德水电费
gravatar wxx_acm
2022-09-09T09:36:33+00:00
<!--Markdown--> 阿萨德发的说法