/*
//ACM Poj 1009
//File: 1009.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 29, 2009
*/
#include
#include
#include
#include
poj_1008
/*
//ACM Poj 1008
//File: 1008.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 29, 2009
*/
#include
#include
using namespace std;
struct TYD
{
int Dnum;
string Dname;
};
int main()
{
string TkDays[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
string HbMons[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
ostringstream buff;
TYD Tday;
int i,j,n;
int Hyear,Hday, Tyear;
string Hdaystr, Hmonth;
int days,Tdays;
cin>>n;
buff< >Hdaystr>>Hmonth>>Hyear;
Hdaystr=Hdaystr.substr(0,Hdaystr.size()-1);
if (Hdaystr.size()==2)
{
Hday=(Hdaystr[0]-'0')*10+(Hdaystr[1]-'0');
}else
{
Hday=(Hdaystr[0]-'0');
}
if(Hmonth=="uayet")
{
j=18;
}
else
{
for(j=0;j<18;j++)
{
if(Hmonth==HbMons[j])
{
break;
}
}
}
days=Hyear*365+j*20+Hday;
Tyear=days/260;
Tdays=days%260;//注意边界!
Tday.Dname=TkDays[Tdays%20];
Tday.Dnum=Tdays%13+1;
buff<
poj_1007
/*
//ACM Poj 1007
//File: 1007.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 28, 2009
*/
#include
#include
using namespace std;
struct revNum
{
int rvNums;
int order;
};
int getReverseNum(string DNA, int n)
{
int *count=new int[n];
int all=0,i;
for (i=0;i=0;i--)
{
for(int j=0;j>n>>m;
string *DNA=new string[m];
int count=0,temp,i;
revNum *rvNum=new revNum[m];
for(i=0;i>DNA[i];
temp=getReverseNum(DNA[i],n);
//插入排序
if(count==0)
{
rvNum[0].rvNums=temp;
rvNum[0].order=i;
count++;
}
else
{
int j,flag=0;
for(j=0;jj;k--)
{
rvNum[k]=rvNum[k-1];
}
rvNum[j].rvNums=temp;
rvNum[j].order=i;
count++;
flag=1;
break;
}
}//for(int j=0;j
poj_1005
/*
//ACM Poj 1005
//File: 1005.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 28, 2009
*/
#include
#include
poj_2000
/*
//ACM Poj 2000
//File: 2000.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 24, 2009
*/
#include
#include
#include
poj_1006
Problem: http://poj.grids.cn/problem?id=1006
Solution:
#include
#include
#include
using namespace std;
int main()
{
int p, e, i, n=0;
long cp, ce, ci;
short d;
int j=1;//计数用
ostringstream buf;
while(1)
{
cin>>p>>e>>i>>d;
if(p==-1 && e==-1 && i==-1 && d==-1)
{
break;
}
n=d;
while(1)
{
n++;
if((n-p)%23==0 && (n-e)%28==0 && (n-i)%33==0)
{
n-=d;
if(n==0)
{
n=d;
continue;
}
break;
}
//cout< <"*";
}
buf<<"Case "<
poj_1004
#include
using namespace std;
int main()
{
int i;
float all=0, temp=0;
for(i=0;i<12;i++)
{
cin>>temp;
all+=temp;
}
all+=0.005;
cout.precision(2);
//cout.setf(ios_base::showpoint);
cout< <"$"<