函數的问题求解答
// Local Declarationdouble round2 (double);
int NY;
int NM;
int PR;
double IM, P, Q, MP, IY;
NM = NY*12;
IM = IY / 12 / 100;
P = pow(NM,(1+IM));
Q = (P/(P-1));
MP = PR * IM * Q;
// Statements
printf("The amount of the loan (principal) :");
scanf("%d", &PR);
printf("Interest rate / year (per cent) :");
scanf("%lf", &IY);
printf("Interest rate / month (decimal) : %lf\n", IM);
printf("Number of years : ");
scanf("%d", &NY);
printf("Number of Months : %d\n", &NM);
这样写可是到了计算 IM的时候怎么是0?
到NY出来的却是2686712
[此贴子已经被作者于2016-10-26 22:34编辑过]