Run ID:138558
提交时间:2025-11-27 18:11:30
#include <bits/stdc++.h> using namespace std; int main() { int d,f,i,j,k,n,s,e[1000]; char a[1000],b[1000][20]; i=0; while (scanf("%s",a)!=EOF) { i=j=k=0; f=1; while (i<strlen(a)) { while (a[i]!='5' and i!=strlen(a)) { b[k][j++]=a[i]; f=f*10; i++; } if (j>0) { b[k][j]='\0'; f=f/10; d=s=0; while (d<j) { s=s+(b[k][d]-48)*f; f=f/10; d++; } e[k]=s; k++; } f=1; j=0; i++; } sort(e,e+k); i=0; while (i<k) { printf("%d",e[i]); if (i<k-1) printf(" "); i++; } printf("\n"); } return 0; }