Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
712 | 陶俊宸 | 编程求1+1/2+1/3+...+1/n | C++ | Accepted | 100 | 0 MS | 252 KB | 165 | 2019-09-21 17:18:45 |
#include<iostream> int main(){ int a,b=0,d; float c; scanf("%d",&a); d=a; while(b<a){ c=c+1.0/d; b++; d--; } printf("%.3f",c); return 0; }