本文主要是介绍hdu(1178)Heritage from father,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
水题,主要考察了一个数学公式;
#include<stdio.h>int main()
{
int m,k;
double n;
while(scanf("%d",&m),m)
{
n=1.0*m*(m+1)*(m+2)/6.0;
k=0;
while(n>=10)
{
n=n/10;
k++;
}
printf("%.2lfE%d\n",n,k);
}
return 0;
}
这篇关于hdu(1178)Heritage from father的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!