【C语言扩展识别实数负数】2022-5-29
缘由C语言识别整数逆序输出-编程语言-CSDN问答
char str[80]{}, s[20]{};double num[80]{};int count = 0, i = 0, x = 0, j = 0;gets_s(str);while (str[i] != '\0'){j = i;while (str[j] >= '0'&&str[j] <= '9' || str[j] == '.' || str[j] == '-')s[x] = str[j], ++x, ++j;i = j;if(x)num[count] = atof(s), ++count;while (x)s[x] = '\0',--x;s[x] = '\0'; ++i;}for (i = --count; i>=0; i--)printf("%0.4lf,", num[i]);