键盘输入用: scanf("%4d%2d%2d%2d%2d%2d", &year,&mo,&day,&h,&m,&s);include <stdio.h> main(){ char str[]="20131014015835";int year,mo,day,h,m,s;// scanf("%4d%2d%2d%2d%2d%2d", &year,&mo,&day,&h,&m,&s);sscanf(str,"%4d%2d%2d%2d%2d%2d", &year,&mo...
include#include<stdio.h>int main(){ char buf[BUFSIZ]; time_t t = time(NULL); struct tm* now = localtime(&t); strftime(buf,BUFSIZ,"%Y%m%d%H%M%S",now); puts(buf);}