文章
79
粉丝
221
获赞
46
访问
198.3k
#include <iostream> using namespace std; int main() { float n, sum = 0, m = 1, c = 2; cin >> n; for (int i = 0; i < n; i++) { sum += c / m; int temp = c; c += m; m = temp; } printf("%.2f",sum); return 0; }
登录后发布评论
暂无评论,来抢沙发