november lunchtime…event…please help me understand.this is my code.
#include
using namespace std;
int match(string s)
{
if(s==“monday”)
return 1;
else if(s==“tuesday”)
return 2;
else if(s==“wednesday”)
return 3;
else if(s==“thursday”)
return 4;
else if(s==“friday”)
return 5;
else if(s==“saturday”)
return 6;
else if(s==“sunday”)
return 7;
}
int main()
{
int t;
cin>>t;
while(t–)
{
string s;
string e;
int l,r,f=0;
cin>>s>>e>>l>>r;
//cout<<s;
//cin>>
int l1,r1,res=0;
l1=match(s);
r1=match(e);
//cout<<l1<<" "<<r1<<endl;
if(l1>r1)
{
res=7%(l1-r1);
if(res==0)
res=7;
else
res+=1;
}
else
res=r1-l1+1;
//cout<<"res="<<res<<endl;
if(res>=l&&res<=r)
{
if(res==l)
cout<<res<<endl;
else
cout<<"many"<<endl;
}
else
cout<<"impossible"<<endl;
}
}