锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品一区二区三区久久,久久天天躁狠狠躁夜夜躁2O2O,精品无码久久久久久久动漫http://m.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://m.shnenglu.com/xmli/archive/2008/12/03/68462.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Wed, 03 Dec 2008 06:00:00 GMThttp://m.shnenglu.com/xmli/archive/2008/12/03/68462.htmlhttp://m.shnenglu.com/xmli/comments/68462.htmlhttp://m.shnenglu.com/xmli/archive/2008/12/03/68462.html#Feedback0http://m.shnenglu.com/xmli/comments/commentRss/68462.htmlhttp://m.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://m.shnenglu.com/xmli/archive/2008/12/02/68399.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Tue, 02 Dec 2008 08:18:00 GMThttp://m.shnenglu.com/xmli/archive/2008/12/02/68399.htmlhttp://m.shnenglu.com/xmli/comments/68399.htmlhttp://m.shnenglu.com/xmli/archive/2008/12/02/68399.html#Feedback0http://m.shnenglu.com/xmli/comments/commentRss/68399.htmlhttp://m.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://m.shnenglu.com/xmli/archive/2008/12/02/68398.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Tue, 02 Dec 2008 08:13:00 GMThttp://m.shnenglu.com/xmli/archive/2008/12/02/68398.htmlhttp://m.shnenglu.com/xmli/comments/68398.htmlhttp://m.shnenglu.com/xmli/archive/2008/12/02/68398.html#Feedback0http://m.shnenglu.com/xmli/comments/commentRss/68398.htmlhttp://m.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品| 国产精品久久久久影院嫩草 | 久久综合鬼色88久久精品综合自在自线噜噜 | 久久久久久久99精品免费观看| 久久天堂电影网| 香蕉久久久久久狠狠色| 久久久久久久亚洲Av无码| 一本久久久久久久| 中文字幕日本人妻久久久免费| 99久久这里只有精品| 久久精品极品盛宴观看| 亚洲国产精品久久久久久| 亚洲午夜久久久久久久久久| 国产成人精品久久亚洲| 久久久女人与动物群交毛片| 久久精品国产第一区二区| 无码人妻久久一区二区三区| 久久亚洲中文字幕精品一区四| 国产精品99久久99久久久| 亚洲人成无码网站久久99热国产 | 99热热久久这里只有精品68| 国产美女亚洲精品久久久综合| 日韩精品国产自在久久现线拍| 久久水蜜桃亚洲av无码精品麻豆| 亚洲AⅤ优女AV综合久久久| 久久综合狠狠综合久久激情 | 久久国产精品99国产精| 久久久久女人精品毛片| 亚洲精品国产美女久久久| 久久人人爽人人爽人人片AV东京热| 亚洲国产精品久久久久婷婷软件 | 久久亚洲av无码精品浪潮| 久久天堂电影网| 91久久精品视频| 国产精品成人久久久久三级午夜电影| 人妻无码久久一区二区三区免费 | 亚洲va久久久噜噜噜久久天堂| 久久久久久久久66精品片| 久久久久精品国产亚洲AV无码 | 亚洲欧美一级久久精品| 亚洲а∨天堂久久精品|