做不出来了
程序代码:
#include<stdio.h> int main() { int i = 0, j = 0, n = 0, m; char a[80]; int b[80]; gets_s(a); while (a[i] != '\0') { if (a[i] >= '0'&&a[i] <= '9') { m = 10 * n + (a[i] - '0'); n = m; } if ((a[i] >= '0'&&a[i] <= '9') && (a[i + 1] < '0'&&a[i + 1] > '9')) { b[j] = m; j++; m = 0; } i++; } for (i = 0; i < j; i++) printf("%d ", b[i]); printf("\n"); return 0; }