mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
20 lines
329 B
C++
20 lines
329 B
C++
#include<stdio.h>
|
|
#include<math.h>
|
|
int main()
|
|
{
|
|
int n,i,k;
|
|
double s;
|
|
while(scanf("%d",&n),n)
|
|
{
|
|
s=1.0*(n+1)*n/6.0*(n+2);
|
|
k=0;
|
|
while(s>=10)
|
|
{
|
|
s=s/10;
|
|
k++;
|
|
}
|
|
printf("%.2lfE%d\n",s,k);
|
|
}
|
|
return 0;
|
|
}
|