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

强悍的%02d,解决输出问题,节约代码,事半功倍

Posted by Hammer307 at 2009-03-28 21:20:59 on Problem 2080
printf("%d-%02d-%02d %s\n",years,months,days,p[week]);
char *p[7]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
%02d好强啊,省了好多代码。宽度为2,不足左补0.我以前从来不知道!

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