标签:++ pac end col out div car return clu
注意:每次需要更新s值。
#include<iostream> #include<cstdio> #include<cmath> using namespace std; int main(){ double c; int i=0; while(cin>>c){ double s=0.0; if(c==0) break; for(i=2;;i++){ s+=(1.0/i); if(s>=c){ cout<<i-1<<" card(s)"<<endl; break; } } } return 0; }
标签:++ pac end col out div car return clu
原文地址:https://www.cnblogs.com/sweet-ginger-candy/p/11504102.html