Run ID:137185

提交时间:2025-11-16 15:08:02

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int p,e,i,d,s; cin>>p>>e>>i>>d; for(int k=d;;k++){ if(p==e && e==i){ s=p; break; } else if(p<e && p<i){ p+=23; } else if(e<p && e<i){ e+=28; } else if(i<p && i<e){ i+=33; } } cout<<"the next triple peak occurs in "<<s-d<<" days."; return 0; }