题解 | 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;
    }
}

按照条件一个一个搜

全部评论

相关推荐

03-16 12:39
燕山大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务