用c语言将000000000300106修改输出300106
可以使用以下代码将字符串"0000000003001.06"修改输出为"3001.06":
#include <stdio.h>
#include <string.h>
int main() {
char str[] = "0000000003001.06";
char output[20];
int i = 0;
while (str[i] == '0') {
i++;
}
strcpy(output, &str[i]);
printf("%s\n", output);
return 0;
}
运行结果:
3001.06
原文地址: https://www.cveoy.top/t/topic/hV7C 著作权归作者所有。请勿转载和采集!