#include<stdio.h> #include<string.h> int main() { char a[80],b[80]; int x,i=0,j=0; gets(a); x=strlen(a); if(a[i]>=48&&a[i]<=57) { 度b[j]=a[i]; j++; } else { b[j]='*'; j++; } i=1; while(i<=(x-1)) { if(a[i]>=48&&a[i]<=57) { b[j]=a[i]; j++; } else if(b[j-1]!='*') { b[j]='*'; j++; } i++; } b[j]='\0'; puts(b); } /* Main.c: In function 'main': Main.c:7:1: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(a); ^ Main.c:11:1: error: stray '\345' in program 度b[j]=a[i]; ^ Main.c:11:1: error: stray '\272' in program Main.c:11:1: error: stray '\246' in program */ |
Double click to view unformatted code.