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 |
这题是不是有什莫bt数据呀?我老是WA.过了的帮帮忙啊#include <stdio.h> __int64 a[13]; void init() { a[0]=0;a[1]=31;a[2]=a[1]+28;a[3]=a[2]+31;a[4]=a[3]+30;a[5]=a[4]+31;a[6]=a[5]+30;a[7]=a[6]+31;a[8]=a[7]+31;a[9]=a[8]+30;a[10]=a[9]+31;a[11]=a[10]+30;a[12]=a[11]+31; } int isrn(__int64 k) { if (k%100!=0&&k%4==0 || k%400==0) return 1; return 0; } void main() { __int64 hour,minute,second,day,month,year,n,i; __int64 re; double rere; init(); scanf("%I64d",&n); while (n--) { scanf("%I64d:%I64d:%I64d %I64d.%I64d.%I64d",&hour,&minute,&second,&day,&month,&year); re=second+60*minute+3600*hour+86400*(day-1); re+=(year-2000)*86400*365; if (year!=2000) re+=86400*(1+(year-1-2000)/4-(year-1-2000)/100+(year-1-2000)/400); re+=a[month-1]*86400; if (isrn(year)&&month>2) re+=86400; rere=re/86400.0; re=__int64(rere*100000)+100000+10000000; if (re>rere*100000+100000+10000000) re--; second=re%100;re/=100;minute=re%100;re/=100;hour=re%10;re/=10; day=re%100;if (day==0) day=100;re=(re-day)/100; month=re%10;if (month==0) month=10;re=(re-month)/10;year=re; printf("%I64d:%I64d:%I64d %I64d.%I64d.%I64d\n",hour,minute,second,day,month,year); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator