#include<iostream> #include<iomanip>  using namespace std; int  main(){     int i,n;     double f;     while(cin>>n){        f=1.0;        for(i=2;i<=n;i++){           f+=1.0/i;        }         cout.setf(ios::right);      cout.fill('0');       cout.flags(ios::fixed);        cout.precision(2);        cout<<f<< endl;       }     return 0; } 
点赞 7

相关推荐

07-18 18:45
已编辑
中山职业技术学院 Java
投递TP-LINK等公司10个岗位
点赞 评论 收藏
分享
07-21 18:43
门头沟学院 Java
是暑期都招满了吗
ANEOY:今年感觉真是后端地狱级难度了,从暑期就是这样,前端需求非常大
点赞 评论 收藏
分享
苍蓝星上艾露:这简历。。。可以试试我写的开源简历优化工具https://github.com/weicanie/prisma-ai
点赞 评论 收藏
分享
07-21 12:41
已编辑
门头沟学院 Java
steelhead:不是你的问题,这是社会的问题。
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务