Fork me on GitHub

%02d

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

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

posted on 2012-04-07 17:01  pengyingh  阅读(270)  评论(0)    收藏  举报

导航