Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这题是不是有什莫bt数据呀?我老是WA.过了的帮帮忙啊

Posted by c0500301036 at 2005-03-07 20:15:10 on Problem 2210
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator