[c] poj1008
来源:互联网 发布:尘埃3知乎 编辑:程序博客网 时间:2024/05/16 17:44
http://poj.org/problem?id=1008
先把距第一天的时间算出来,再算用另一个计法算出日子就好了,是用取余和整除做的题
#include<iostream>#include<stdio.h>#include<string>using namespace std;string a1[19]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};string a2[20]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};int main(){int n;cin>>n;cout<<n<<endl;for(int i=0;i<n;i++){int x;cin>>x;string a;cin>>a;cin>>a;int y;cin>>y;int day;int m;for(int j=0;j<20;j++){if(a==a1[j]){m=j;break;}}day=x+m*20+y*365;int ry=day/260;int rm=day%260%20;int rd=day%13+1;cout<<rd<<' '<<a2[rm]<<' '<<ry<<endl;}return 0;}
0 0
- [c] poj1008
- poj1008
- POJ1008
- POJ1008
- poj1008
- POJ1008
- poj1008
- poj1008
- poj1008
- poj1008
- POJ1008
- POJ1008
- poj1008
- poj1008
- poj1008
- POJ1008
- poj1008
- POJ1008
- swift - The Flyweight Pattern
- java内存管理和垃圾回收机制
- 《C#入门经典(第6版)》读书笔记3_第三章:变量和表达式
- 虚函数表的实现细节
- hdu 2602 Bone Collector(经典dp)
- [c] poj1008
- hdoj 2246 Interesting Housing Problem 【最大费用最大流 or KM算法】
- linux上安装svn服务
- linux socket网络编程详解
- DataStructure-8.2-平衡二叉树
- Install Jekyll
- 在学习单例模式关于单例数据更新遇到个BUG!(错误)
- git基础使用方法整理
- jquery一些记录(老是搞忘函数用法,规则)