超简单C语言程序?
发布网友
发布时间:2022-05-09 19:56
我来回答
共2个回答
热心网友
时间:2023-10-16 10:25
main()
{float sum=100;
int i;
i=1;
while(i<=10)
{sum*=(1+0.003);
i++;
}
printf("use while cuculate : %f\n",sum);
i=1;
sum=100;
do
{sum*=(1+0.003);
i++;
}while(i<=10);
printf("use do while cuculate : %f\n",sum);
sum=100;
for(i=1;i<=10;i++)
sum*=(1+0.003);
printf("use for cuculate : %f\n",sum);
getch();
}
热心网友
时间:2023-10-16 10:26
int sum = 100;
for(int i=1;i<11;i++)
{
sum = sum*(1+0.3)
}