Saturday, August 27, 2016

uri- 1155 - S Sequence

#include<cstdio>

int main()
{
    double s=1.0;
    for(int i=2;i<=100;i++){
       s+=1.0/(double) i;
    }
    printf("%.2lf\n",s);
    return 0;
}

No comments: