69,371
社区成员
发帖
与我相关
我的任务
分享
char buff[3];
sprintf(buff, "%1.2x", offset);
printf("S%1.2sE", ""); // S E,最短为1,空字符串补一个空格
printf("S%1.2sE", "1"); // S1E
printf("S%1.2sE", "12"); // S12E
printf("S%1.2sE", "123"); // S12E 最长为2,只输出前2个字符