锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品无码久久千人斩,亚洲国产精品成人久久蜜臀 ,欧美久久综合性欧美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;
}




]]>
精品免费久久久久久久| 九九久久精品国产| 亚洲午夜久久久影院伊人| 久久天天躁狠狠躁夜夜躁2014| 97精品依人久久久大香线蕉97| 久久天天躁狠狠躁夜夜网站| 久久久精品一区二区三区| 中文成人无码精品久久久不卡 | 国产激情久久久久影院小草 | 久久只有这精品99| 久久夜色精品国产欧美乱| 久久99精品九九九久久婷婷| 影音先锋女人AV鲁色资源网久久| 久久99国产精品尤物| 欧美亚洲国产精品久久| 99久久www免费人成精品| 精品久久久无码21p发布| 国产精品成人精品久久久 | 国内精品久久九九国产精品| 久久国产影院| 久久99精品久久久久久动态图| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久99国产综合精品免费| 久久99国产精品久久99小说| 久久se这里只有精品| 大伊人青草狠狠久久| 亚洲欧美日韩中文久久| 一本色道久久综合| 久久精品国产亚洲7777| 国产99久久久国产精免费| 久久精品国内一区二区三区| 精品少妇人妻av无码久久| 亚洲精品无码久久久影院相关影片| 日本久久中文字幕| 欧美激情精品久久久久久久| 久久国产福利免费| 久久精品中文字幕一区| 日韩电影久久久被窝网| 久久久国产视频| 日韩欧美亚洲综合久久| 久久久久久精品久久久久|