第一个:
printf("%04d", 12);第二个自己用程序实现吧.
char s[] = "0123012340001";
int s = (strlen(s)%4 == 0)?strlen(s) : strlen(s) + 1;
int *ret = new int[s];
for(int i = 0; i < s; i ++)
{
  char chTemp[5];
  ZeroMemory(chTemp, 5);
  strncpy(chTemp, s, i*4);
  ret[i] = atoi(chTemp);
}//使用retdelete ret;