#include using namespace std;int main(){int n = 1,limit;double sum = 0;cin >> limit ;while (sum <= limit){sum += 1/n;n++;}cout << "n=" << n<<"sum="<<sum ;
return 0;
}
Cats萌萌
弑天下
相关分类