题解 | Biorhythms

#include <iostream>
using namespace std;

int main() {
    int p,e,i,d;
    while(cin>>p>>e>>i>>d){
        int temp=1;
        for(;;temp++){
            if((temp-p)%23==0&&(temp-e)%28==0&&(temp-i)%33==0)break;
        }
        cout<<"Case: the next triple peak occurs in "<<temp-d<<" days."<<endl;
    }
}

按照条件一个一个搜

全部评论

相关推荐

神哥了不得:(非引流)先把你的个人信息打码一下吧,看了几万份的简历,让我不知道该怎么说
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务