对于C编程。如何将数字显示为00、01、02、03,而不是0、1、2、3。我只需要在10之前加上0。
我知道当你处理小数时,可以使用"%.2f"等方式。但整数反过来怎么办?
这是我正在使用的代码...**
printf("Please enter the hours: ");
scanf ("%d",&hour);
printf("Please enter the minutes: ");
scanf ("%d",&minute);
printf("Please enter the seconds: ");
scanf ("%d",&second);
printf("%d : %d : %d\n", hour, minute, second);
我需要将数字显示为 00 : 00 : 00
??