diff --git a/QUSTOJ/1775.c b/QUSTOJ/1775.c new file mode 100644 index 0000000..94bc2fc --- /dev/null +++ b/QUSTOJ/1775.c @@ -0,0 +1,18 @@ +#include +#include + +int main() +{ + int n; + scanf("%d",&n); + double ans=0; + if(n%2==1) + { + for(int k=1;k<=n;k+=2) ans+=1.0/k; + } + else + { + for(int k=2;k<=n;k+=2) ans+=1.0/k; + } + return printf("%f\n",ans),0; +}