Ответ(ы) на вопрос:
Гость
//Dev-C++ 5.11
#include
using namespace std;
int main(void)
{const int mounthDuration[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char c;
int boxNum,n,boxMounth,boxDay,currentDay,currentMounth,res[100],resi=0;
for(int j=0;j<5;j++)
{cin>>c;
switch(j){
case 0:currentDay=(c-'0')*10; break;
case 1:currentDay+=c-'0'; break;
case 3:currentMounth=(c-'0')*10; break;
case 4:currentMounth+=c-'0'; break;}}
cin>>n;
for(int i=0;i>boxNum;
for(int j=0;j<5;j++)
{cin>>c;
switch(j){
case 0:boxDay=(c-'0')*10; break;
case 1:boxDay+=c-'0'; break;
case 3:boxMounth=(c-'0')*10; break;
case 4:boxMounth+=c-'0'; break;}}
if(boxMounth==currentMounth)
{if(currentDay-boxDay>3)
{res[resi]=boxNum;
resi++;}}
else
if(currentMounth-boxMounth>=1 && currentDay+(mounthDuration[boxMounth]-boxDay)>3)
{res[resi]=boxNum;
resi++;}}
for(int i=0;i
Не нашли ответ?
Похожие вопросы