#include<stdio.h> #include<string.h> int main(){ int i,count=0,j=0,w; char str1[90],str2[90]; scanf("%s",str1); for(i=0;i<strlen(str1);i++){ if('0'<=str1[i]&&str1[i]<='9'){ str2[j++] = str1[i]; }else{ str2[j++]='*' } } for(i=0;i<strlen(str2);i++){ if('0'<=str2[i]&&str2[i]<='9'){ printf("%c",str2[i]); } else if(str2[i]=='*'&&str2[i+1]=='*'); else printf("%c",str2[i]); } printf("\n"); return 0; } /* Main.c: In function 'main': Main.c:15:3: error: expected ';' before '}' token } ^ Main.c:5:20: warning: unused variable 'w' [-Wunused-variable] int i,count=0,j=0,w; ^ Main.c:5:8: warning: unused variable 'count' [-Wunused-variable] int i,count=0,j=0,w; ^ */ |
Double click to view unformatted code.