mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
11 lines
221 B
C++
11 lines
221 B
C++
|
#include<stdio.h>
|
||
|
int main(){
|
||
|
double m,j,i;
|
||
|
while(scanf("%lf",&m)!=EOF&&m!=0){
|
||
|
j=0;int k=1;
|
||
|
for(i=m;i>=1;i--)
|
||
|
j=j+1.00/i*k++;
|
||
|
printf("%.2f\n",2*j-m);}
|
||
|
return 0;
|
||
|
}
|