请问这样写for错在哪里?
22. Write a program which requests a user to enter an amount of money. The programprints the interest payable per year for rates of interest from 5% to 12% in steps
of 0.5%.
#include <stdio.h>
int main (){
int y=0;
double m,r,i;
printf ("enter the amount of money : ");
scanf ("%lf",&m);
printf ("YEAR INTEREST\n\n");
for (r=0.05; r<=0.12; r+=0.005; y++)
i=m*r;
printf ("\n%d %6.2f",y,i);
}
[此贴子已经被作者于2019-9-25 17:55编辑过]