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 |
真的是改个输出就ac了,不信你拿我的程序去ac看看(cout改成printf就ac了)!请大牛看看这是为什么?#include <iostream> #include <stdlib.h> using namespace std; char year[19][10] = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; char month[20][10] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int renum(char *ch) { int i; for( i=0; i<20; i++) if(strcmp(ch,year[i]) == 0) break; return i; } int main() { int n,num1,num2; long sum; char ch[10]; cin>>n; cout<<n<<endl; for(int i=0; i<n; i++) { cin>>num1; getchar(); getchar(); cin>>ch>>num2; sum = num1 + renum(ch) * 20 + num2 * 365; printf("%d %s %d\n",1+sum%13,month[sum%20],sum/260);//两个输出不同 //cout<<(1+sum%13)<<ends<<month[sum%20]<<ends<<(sum/260)<<endl;// } return 1; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator