#include<iostream> #include<cstring> using namespace std; int main() { char a[100]; int num = 1; gets(a); for (int i = 0; i < strlen(a); i++) { if (a[i] >= '0'&&a[i] <= '9') { cout << a[i]; num = 1; } else{ if(num == 1) { cout << "*"; num = 0; } else if (num == 0) { } } } return 0; } |
Double click to view unformatted code.