#include <stdio.h>
int main(void) {
double x,y,z,pay,rate,loan;
scanf("%.2f\n%.2f\n%.2f", &loan, &rate, &pay);
x=loan-pay+rate/12*0.01*loan;
y=x-pay+rate/12*0.01*x;
z=y-pay+rate/12*0.01*y;
printf("%.2f\n", x);
printf("%.2f\n", y);
printf("%.2f", z);
return 0;
}
scanf("%.2f\n%.2f\n%.2f", &loan, &rate, &pay);
改成
scanf("%lf\n%lf\n%lf", &loan, &rate, &pay);
試試看