第一次AC(20090115)【题解经验】
//Start:20090114
//Finish:20090114//AC:20090115 POJ 264K 0MS//Welkin#include <iostream>
using namespace std;
int main(){double m,t,res;cin >>m;while(m!=0.00){for(t=2,res=0;m-res>0.0001;t++)//0.001为临界值{res=res+1/t;}//forcout <<t-2<<" card(s)"<<endl;cin >>m;}return 0;}
POJ1006:
//Start:20090114
//Finish:20090115//AC:20090115 POJ 264K 766MS//Welkin#include <iostream>
using namespace std;
int main()
{int p,e,i,d,res,j=0;const int P=23,E=28,I=33;cin >>p>>e>>i>>d;while (p != -1){while(p>=P){p-=P;}while(e>=E){e-=E;}while(i>=I){i-=I;}res=p;while(!( ((res-p)%P==0) && ((res-e)%E==0) && ((res-i)%I==0) )){res++;}res-=d;while(res <=0){res+=21252;}cout <<"Case "<<++j<<": the next triple peak occurs in "<<res<<" days."<<endl;cin >>p>>e>>i>>d;}return 0;}
最后,希望大家加油啊!天天AC天天好心情,呵呵o(∩_∩)o...