锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品一区二区三区久久,久久天天躁狠狠躁夜夜躁2O2O,精品无码久久久久久久动漫http://www.shnenglu.com/xmli/category/9027.html銇烽洩椋樼粵姊呮槧孌嬬孩 <br> &nbsp;&nbsp; 銇瘋姳鑸為湝椋炴槧鑻嶆澗<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----- Do more,suffer lesszh-cnWed, 03 Dec 2008 08:36:25 GMTWed, 03 Dec 2008 08:36:25 GMT60Friday the Thirteenthhttp://www.shnenglu.com/xmli/archive/2008/12/03/68462.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Wed, 03 Dec 2008 06:00:00 GMThttp://www.shnenglu.com/xmli/archive/2008/12/03/68462.htmlhttp://www.shnenglu.com/xmli/comments/68462.htmlhttp://www.shnenglu.com/xmli/archive/2008/12/03/68462.html#Feedback0http://www.shnenglu.com/xmli/comments/commentRss/68462.htmlhttp://www.shnenglu.com/xmli/services/trackbacks/68462.html棰樼洰錛?a >Friday the Thirteenth

綆絳旓細


/*
ID: lixianm1
PROG: friday
LANG: C++
*/
#include 
<fstream>
#include 
<iostream>
#include 
<vector>
#include 
<map>
#include 
<string>
#include 
<cassert>

inline 
bool IsLeapYear(unsigned int nYear) {return ((!(nYear&3))&&(0!=nYear%100))||(0==nYear%400);}

int main(int argc, char* argv[]) 
{    
    
//////////////////////////////////////////////////////////////////////////open the file
    std::string strInFile    = "friday.in";
    std::
string strOutFile    = "friday.out";

    std::ifstream fin(strInFile.c_str());
    std::ofstream fout(strOutFile.c_str());

    
if (!fin)
    {
        std::cout
<<"failed to open file for read"<<std::endl;
        
return 1;
    }
    
if (!fout)
    {
        std::cout
<<"failed to open file for write"<<std::endl;
        fin.close();
        
return 1;
    }
    
//////////////////////////////////////////////////////////////////////////read file and init all variables
    

    
int N;
    fin
>>N;

    
//////////////////////////////////////////////////////////////////////////process

    
static int month_day[]={0312831303130313130313031};
    
static int month_day2[]={0312931303130313130313031};

    
int aWeekCount[7]={0};
    unsigned 
int nTotalDays= 0;

    
for (int i=0; i<N; ++i)
    {
        
for (int nMonth=1; nMonth<13++nMonth)
        {
            
++aWeekCount[(nTotalDays+12)%7];
            
            
if (!IsLeapYear(1900+i))
            {
                nTotalDays
+=month_day[nMonth];
            }
else
            {
                nTotalDays
+=month_day2[nMonth];
            }            
        }        
    }
    
    
//////////////////////////////////////////////////////////////////////////write the process result
    for (int i=0; i<6++i)
    {
        fout
<<aWeekCount[(i+5)%7]<<" ";
    }
    fout
<<aWeekCount[4]<<std::endl;

    
//////////////////////////////////////////////////////////////////////////end and exit
    fin.close();
    fout.close();

    
//system("pause");
    return 0;
}



]]>
Your Ride Is Herehttp://www.shnenglu.com/xmli/archive/2008/12/02/68399.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Tue, 02 Dec 2008 08:18:00 GMThttp://www.shnenglu.com/xmli/archive/2008/12/02/68399.htmlhttp://www.shnenglu.com/xmli/comments/68399.htmlhttp://www.shnenglu.com/xmli/archive/2008/12/02/68399.html#Feedback0http://www.shnenglu.com/xmli/comments/commentRss/68399.htmlhttp://www.shnenglu.com/xmli/services/trackbacks/68399.htmlYour Ride Is Here
  榪樻槸姣旇緝綆鍗曠殑

  綆絳旓細


/*
ID: lixianm1
PROG: ride
LANG: C++
*/
#include 
<fstream>
#include 
<iostream>
#include 
<string>

unsigned 
int hash(const std::string& s)
{
    unsigned 
int nNum    = 1;
    unsigned 
int nSize    = s.length();
    
for (int i= 0; i<nSize; ++i)
    {
        nNum
*=(s[i]-'A'+1);
    }
    
return nNum%47;
}

int main(int argc, char* argv[]) 
{    
    std::
string strInFile    = "ride.in";
    std::
string strOutFile    = "ride.out";

    std::ifstream fin(strInFile.c_str());
    
if (!fin)
    {
        std::cout
<<"failed to open file for read"<<std::endl;
        
return 1;
    }

    std::
string strComet, strGroup;
    std::getline(fin, strComet);
    std::getline(fin, strGroup);
    fin.close();

    std::ofstream fout(strOutFile.c_str());
    
if (!fout)
    {
        std::cout
<<"failed to open file for write"<<std::endl;
        
return 1;
    }

    
if (hash(strComet)==hash(strGroup))
    {
        fout
<<"GO"<<std::endl;
    }
else
    {
        fout
<<"STAY"<<std::endl;
    }
    fout.close();
    
    
return 0;
}



]]>
Greedy Gift Givershttp://www.shnenglu.com/xmli/archive/2008/12/02/68398.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Tue, 02 Dec 2008 08:13:00 GMThttp://www.shnenglu.com/xmli/archive/2008/12/02/68398.htmlhttp://www.shnenglu.com/xmli/comments/68398.htmlhttp://www.shnenglu.com/xmli/archive/2008/12/02/68398.html#Feedback0http://www.shnenglu.com/xmli/comments/commentRss/68398.htmlhttp://www.shnenglu.com/xmli/services/trackbacks/68398.htmlGreedy Gift Givers
  棰樼洰鏈瘮杈冪畝鍗曪紝浣嗘垜璇諱簡鍗婂ぉ鎵嶇畻璇繪噦錛岃嫳鏂囨按騫寵窡涓嶄笂浜嗐?br>  棰樼洰澶ф剰錛氭湁NP涓漢錛屾瘡涓漢閮藉悜鍏朵粬浜洪侀挶錛屽悓鏃朵粬鍙堜細鏀跺埌鍒漢閫佺粰浠栫殑閽便傞鐩姹傝綆楁瘡涓漢鏀跺埌鐨勯挶姣旈佸嚭鐨勯挶澶氬灝戙?br>
瑙g瓟錛?br>

/*
ID: lixianm1
PROG: gift1
LANG: C++
*/
#include 
<fstream>
#include 
<iostream>
#include 
<vector>
#include 
<map>
#include 
<string>
#include 
<cassert>

typedef std::vector
<std::string>    StrVector;

struct Person
{
    std::
string    name;            // name
    int            money_send;        // money for sending
    int            money_receive;    // money received
    StrVector    receiver;        // all receivers

    Person()
    {
        money_send        
= 0;
        money_receive    
= 0;
    }
};

typedef std::map
<std::string, Person>    PersonMap;

int main(int argc, char* argv[]) 
{    
    
//////////////////////////////////////////////////////////////////////////open the file
    std::string strInFile    = "gift1.in";
    std::
string strOutFile    = "gift1.out";

    std::ifstream fin(strInFile.c_str());
    std::ofstream fout(strOutFile.c_str());

    
if (!fin)
    {
        std::cout
<<"failed to open file for read"<<std::endl;
        
return 1;
    }
    
if (!fout)
    {
        std::cout
<<"failed to open file for write"<<std::endl;
        fin.close();
        
return 1;
    }
    
//////////////////////////////////////////////////////////////////////////read file and init all variables
    int            nPersonNum;
    PersonMap    mPerson;
    StrVector    vPersonName;

    fin
>>nPersonNum;
    assert(nPersonNum
>0);
    
for(int i=0; i<nPersonNum; ++i)
    {
        Person    person;
        fin
>>person.name;
        mPerson[person.name]
= person;
        vPersonName.push_back(person.name);
    }
    
    std::
string strName;
    
while(fin>>strName)
    {
        fin
>>mPerson[strName].money_send;
        
int nReceiver;
        fin
>>nReceiver;
        std::
string strReceiverName;
        
for (int i=0; i<nReceiver; ++i)
        {
            fin
>>strReceiverName;
            mPerson[strName].receiver.push_back(strReceiverName);
        }        
    }    

    
//////////////////////////////////////////////////////////////////////////process
    
    
for (PersonMap::iterator iter= mPerson.begin(); mPerson.end()!=iter; ++iter)
    {
        Person
&    person    = iter->second;
        
int nReceiverNum    = person.receiver.size();
        
if ((0!=nReceiverNum))
        {
            
int nMoneySend        = person.money_send/nReceiverNum;

            
for (int i=0; i<nReceiverNum; ++i)
            {
                mPerson[person.receiver[i]].money_receive
+= nMoneySend;
            }

            person.money_send    
= nMoneySend*nReceiverNum;
        }
    }
    
//////////////////////////////////////////////////////////////////////////write the process result
    for (StrVector::iterator iter= vPersonName.begin(); vPersonName.end()!=iter; ++iter)
    {
        fout
<<*iter<<" "<<mPerson[*iter].money_receive-mPerson[*iter].money_send<<std::endl;
    }

    
//////////////////////////////////////////////////////////////////////////end and exit
    fin.close();
    fout.close();
    
//system("pause");
    return 0;
}




]]>
久久99精品国产麻豆蜜芽| 久久精品中文无码资源站| 亚洲欧美成人综合久久久| 国产香蕉久久精品综合网| 亚洲va久久久噜噜噜久久天堂| 亚洲精品乱码久久久久久蜜桃不卡 | 亚洲一级Av无码毛片久久精品| 亚洲а∨天堂久久精品9966| 久久亚洲精品国产精品| 久久久WWW免费人成精品| 久久夜色精品国产噜噜噜亚洲AV| 美女写真久久影院| 亚洲精品无码久久久久去q| 久久久青草青青亚洲国产免观| 欧美午夜A∨大片久久| 国产欧美久久久精品| 久久久久亚洲AV无码专区体验| 欧美亚洲国产精品久久久久| 国产99久久久国产精品~~牛 | 人妻精品久久久久中文字幕一冢本| 久久99精品国产99久久6男男| 精品伊人久久久| 久久亚洲色一区二区三区| 久久精品国产99国产精品| 国产情侣久久久久aⅴ免费| 久久亚洲美女精品国产精品| 欧美午夜A∨大片久久 | 狠狠久久综合伊人不卡| 天堂久久天堂AV色综合| 国产精品久久久久久久久软件| 久久se这里只有精品| 国产福利电影一区二区三区久久久久成人精品综合 | 性欧美大战久久久久久久久| 青春久久| 欧美久久一级内射wwwwww.| 精品久久久久久久久久久久久久久| 国产91色综合久久免费| 91久久九九无码成人网站| 久久久久一本毛久久久| 很黄很污的网站久久mimi色| 久久久久久国产精品免费免费|