Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
1018 沈文佳 编程求1+1/2+1/3+...+1/n C++ Accepted 100 0 MS 252 KB 145 2019-09-27 20:46:04

Tests(9/9):


#include<iostream> int main(){ double a,b=2,c=1; scanf("%lf",&a); while(b<=a){ c=c+1/b; b++; } printf("%.3lf",c); return 0; }


Judgement Protocol: