#include <iostream> #include <cstdio> using namespace std; int main(){ char a[999],b[999]; cin.getline(a,999); int flag=1,k=0; for(int i=0;i<strlen(a);i++){ if(isdigit(a[i])){ flag = 1; b[k++]=a[i]; } else if(flag==1){ flag=0; b[k++]='*'; } } for(int i=0;i<k;i++){ cout<<b[i]; } cout<<endl; return 0; } /* Main.cc: In function 'int main()': Main.cc:8:27: error: 'strlen' was not declared in this scope for(int i=0;i<strlen(a);i++){ ^ */ |
Double click to view unformatted code.