12021
2013-12-02 09:07 Summer.xia 阅读(141) 评论(0) 编辑 收藏 举报#include <stdio.h> int main(){ double s; int z, n, i; scanf("%d", &z); while (z-- != 0){ scanf("%d", &n); s = 0; for (i=1; i<=n; i+=2){ s += 1.0/i; } for (i=2; i<=n; i+=2){ s -= 1.0/i; } printf("%.2lf\n", s); } return 0; }