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 |
我这为什么不能通过啊,求指教,输出例子对的上,前边大神给的数据输出也对的#include <iostream> #include <fstream> #include <iomanip> #include <cstring> using namespace std; int main() { ifstream cin("input.txt"); char HaabMonthName[19][10] = {"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"}; char TzolkinDayName[20][12] = {"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int n; cin >> n; cout << n << endl; int i; int HaabDay; char dot; char HaabMonth[7]; int HaabYear; int allDay; int TzolkinYear; int TzolkinMonth; int TzolkinDay; while (n > 0) { cin >> HaabDay >> dot >> HaabMonth >> HaabYear; for(i = 0; i < 19; i ++) { if(strcmp(HaabMonth, HaabMonthName[i]) == 0) { break; } } allDay = HaabYear * 365 + 20 * i + HaabDay; //cout << allDay << endl; TzolkinYear = (allDay - 1) / 260; i = allDay % 260; TzolkinMonth = i % 13; TzolkinMonth ++; TzolkinDay = i % 20; cout << TzolkinMonth << " " << TzolkinDayName[TzolkinDay] << " " << TzolkinYear; //cout << TzolkinMonth << " " << TzolkinDay << " " << TzolkinYear; cout << endl; n --; } system("PAUSE"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator