| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:题意不清 应该这样In Reply To:题意不清 应该这样 Posted by:yanzhengfei at 2009-07-29 16:32:06 > 输入 3
> 输出 3
> 输入 10. zac 0
> 输出 3 chuen 0
> 输入 0. pop 0
> 输出1 imix 0
> 输入 10. zac 1995
> 输出 9 cimi 2801
>
>
> 输入有两个空格 输出也有两个空格
> 描述得太不清楚了
>
> #include"iostream"
> #include"string"
> using namespace std;
> int main()
> {
> int n;
> cin>>n;
> cout<<n<<endl;
> char str[][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
> char nt[][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
> int i;
> int dh=0,yh=0;
> int dt,yt,k;
> long int days=0;
> char s[7];
> while(n--)
> {
> scanf("%d. %s %d",&dh,s,&yh);
> for(i=0;i<19;i++)
> if(!strcmp(str[i],s)) break;
> days=365*yh+i*20+dh;
> yt=days/260;
> days=days-yt*260;
> dt=days%13+1;
> k=days%20;
> printf("%d %s %d\n",dt,nt[k],yt);
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator