OpenJudge//////////细菌繁殖

OpenJudge//////////细菌繁殖_第1张图片

OpenJudge//////////细菌繁殖_第2张图片

#include
using namespace std;
int main()
{
    int n,i,j;

    cin>>n;
    int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=1;i<=n;i++)
    {
        int startmonth,firstday,endmonth,endday;
        long  firstnum,endnum;
        int sum=0;
        cin>>startmonth>>firstday>>firstnum>>endmonth>>endday;
        for(j=startmonth;j<endmonth;j++)
        {
            sum=days[j-1]+sum;
        }
        sum=sum-firstday;
        sum=sum+endday;
        endnum=firstnum;
        for(j=0;j<sum;j++)
            endnum=2*endnum;
        cout<<endnum<<endl;
        }
}

你可能感兴趣的:(openjudge)