题解 | #Biorhythms#

Biorhythms

https://www.nowcoder.com/practice/aa66f85934c142f3af2da111dc864d9f

#include <iostream>
#include <cstring> 
#include <algorithm>
#include <math.h>
#include <string.h> 
#include <stdlib.h>
using namespace std;
int main(){
	int body = 23;
	int motion = 28;
	int intell = 33;

	int p, e, i ,d, day;
	cin >> p >> e >> i >> d;
    for(day = 1;day <= 21252 ; day++){
        if ((day-p)%body == 0 && (day-e)%motion == 0 && (day-i)%intell == 0) break;
    }
	cout << "Case: the next triple peak occurs in "<< day-d << " days.";
}

全部评论

相关推荐

2025-12-15 14:25
云南大学 Java
lei22:入职可能会看学信网,最好别伪装,这个简历找实习肯定是够的,肯定会有收 28 届实习生的公司的,多投就行
点赞 评论 收藏
分享
哞客37422655...:github如果提交不是很多 可以不写 可能会是减分项。之前听别人讲过的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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